-
Notifications
You must be signed in to change notification settings - Fork 0
/
proteus_en_py.txt
65 lines (53 loc) · 1.34 KB
/
proteus_en_py.txt
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
import ui
import random
import proteus_list_en
def init(liste,bild):
i=0
j=0
for word in liste:
if len(word)==1:
try:
bild[str(i+20)].title = word
i=i+1
except:
break
else:
try:
if j> 19:
break
bild[str(j)].title = word
j=j+1
except:
break
def check(liste, wort, thing):
j = next((i for i, sublist in enumerate(liste) if wort in sublist), -1)
if len(thing) == 1:
if thing =="4":
if len(liste[j][0])==4:
return True
else:
return False
elif thing in liste[j][0]:
return True
else:
return False
else:
if thing in liste[j]:
return True
else:
return False
def button_tapped(sender):
'@type sender: ui.Button'
v = sender.superview
t = sender.title
if t=="Reveal":
v['out'].text = wahl
elif check(proteus_list_en.data,wahl,t):
v['out'].text = "Yes"
else:
v['out'].text = "No"
v = ui.load_view('proteus_en')
v.present()
init(proteus_list_en.tags, v)
n=random.randint(0,len(proteus_list_en.data))
wahl=proteus_list_en.data[n][0]