-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathExample.py
137 lines (122 loc) · 4.44 KB
/
Example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import Mentifxxr
import random
try:
pin = input("Input Pin\n> ")
while 1:
print()
try:
y = Mentifxxr.getInfo(pin)
Mentifxxr.printInfo(y)
wordlist = [
"favor",
"heavyweight",
"became",
"habit",
"battleground",
"growl",
"fundamental",
"rear",
"estimate",
"quantum",
"soon",
"ambitious",
"grappler",
"limitless",
"nuclear",
"bluster",
"teeth",
"crutch",
"pigeon",
"bed",
]
t = Mentifxxr.getActiveQuestionType(y)
q = Mentifxxr.getActiveQuestionid(y)
print("Current question type is:", t)
if t == "wordcloud":
word = input(
"\nNothing to send 1024 random numbers\nRandom to send random words\nWhat to say\n> "
).replace(" ", "_")
if word == "":
for x in range(1024):
word += str(random.randint(0, 9))
elif word == "random" or word == "Random":
word = wordlist
elif (
(t == "choices")
| (t == "choices_images")
| (t == "winner")
| (t == "ranking")
):
word = int(input("choose No.\n> "))
elif t == "open":
while 1:
word = input(
"Nothing to enter 250 random numbers\nMust be less than 250 chars\n> "
)
if word == "":
for x in range(250):
word += str(random.randint(0, 9))
break
elif len(word) < 250:
break
elif t == "scales":
word1 = []
word = {}
print(
"Enter a value for each question with a value from",
str(Mentifxxr.getActiveQuestionMinMax(y)["min"])
+ "-"
+ str(Mentifxxr.getActiveQuestionMinMax(y)["max"]),
"or nothing to skip",
)
while len(word1) < len(Mentifxxr.getActiveQuestion(y)):
try:
e = input("> ")
if e == "":
pass
else:
e = int(e)
if (e <= Mentifxxr.getActiveQuestionMinMax(y)["max"]) & (
e >= Mentifxxr.getActiveQuestionMinMax(y)["min"]
):
word1.append(e)
else:
print("Value too small or large, try again")
except ValueError:
pass
if e == "":
word1.append(e)
print(Mentifxxr.getActiveQuestion(y))
for z in Mentifxxr.getActiveQuestion(y):
for x in range(1, len(word1) + 1):
if word1[x - 1] == "":
word[z["id"]] = "other"
else:
word[z["id"]] = [word1[x - 1], 1]
print(word)
elif t == "qfa":
word = input("Your question\n> ")
times = int(input("Times\n> "))
except KeyboardInterrupt:
print("Interrupt detected")
exit()
except ValueError:
times = 1
print("No value enterd, defaulting to 1")
r = range(times)
if word == "wordlist":
r = wordlist
try:
print("sending", len(word), "characters")
for x in r:
newid = Mentifxxr.getNewID()
if word == "wordlist":
Mentifxxr.answer(q, t, newid, y, x)
else:
Mentifxxr.answer(q, t, newid, y, word)
print("\r", x + 1, "/", len(r), end="\r")
except KeyboardInterrupt:
print("Interrupt detected, Quitting")
exit()
except KeyboardInterrupt:
print("Interrupt detected, Quitting")