-
Notifications
You must be signed in to change notification settings - Fork 0
/
inicijativa-EN.py
63 lines (61 loc) · 1.87 KB
/
inicijativa-EN.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
import os, sys
name = []
initiative = []
note = []
rnd = 0
def inchg(y, initiative):
while True:
try:
inic = int(input("New initiative: "))
except ValueError:
continue
else:
if inic < initiative[y]:
initiative[y] = inic
break
print("Inicijativa 1.1EN (c) 2017 Ivan Žalac\n")
while True:
try:
n = int(input("Number of entries: "))
except ValueError:
continue
else:
break
for i in range (n):
print("\nEntry no. " + str(i+1))
name.append(input("Name: "))
note.append(" ")
while True:
try:
inic = int(input("Initiative: "))
except ValueError:
continue
else:
initiative.append(inic)
break
initiative, name = (list(t) for t in zip(*reversed(sorted(zip(initiative, name)))))
while 1:
rnd += 1
i = 0
print("\n\nRound " + str(rnd) + "\nCommands: (D)elay, N(E)xt round, (N)ote, (R)emove, re(S)et, (Q)uit\nor just press Enter for next entry.\n")
while i < n:
if initiative[i] == -256:
inp="e"
else:
inp = input("Next: " + name[i] + " (" + str(initiative[i]) + ") # " + note[i] + " # ")
if inp.lower() == 'd':
inchg(i, initiative)
initiative, name, note = (list(t) for t in zip(*reversed(sorted(zip(initiative, name, note)))))
elif inp.lower() == 'e':
break
elif inp.lower() == 'n':
note[i] = input("Note: ")
elif inp.lower() == 'r':
initiative[i] = -256
initiative, name, note = (list(t) for t in zip(*reversed(sorted(zip(initiative, name, note)))))
elif inp.lower() == 's':
os.execl(sys.executable, sys.executable, *sys.argv)
elif inp.lower() == 'q':
sys.exit()
else:
i += 1