-
Notifications
You must be signed in to change notification settings - Fork 0
/
darts3.py
170 lines (164 loc) · 5.87 KB
/
darts3.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# DARTS by iLLVAN
import simpleaudio as sa
import sys
import time
aud_whut = sa.WaveObject.from_wave_file("whut.wav")
aud_lo11 = sa.WaveObject.from_wave_file("Loop11.wav")
aud_loop = sa.WaveObject.from_wave_file("Loop.wav")
aud_loo2 = sa.WaveObject.from_wave_file("Loop2.wav")
aud_loo3 = sa.WaveObject.from_wave_file("Loop3.wav")
aud_loo8 = sa.WaveObject.from_wave_file("Loop8.wav")
aud_rhod = sa.WaveObject.from_wave_file("Rhodes1.wav")
aud_sati = sa.WaveObject.from_wave_file("satie2.wav")
aud_trom = sa.WaveObject.from_wave_file("tromb.wav")
aud_yeah = sa.WaveObject.from_wave_file("yea.wav")
aud_hhs1 = sa.WaveObject.from_wave_file("HHS1.wav")
aud_meta = sa.WaveObject.from_wave_file("metallic.wav")
aud_bott = sa.WaveObject.from_wave_file("BOTTTLEZZ.wav")
aud_craz = sa.WaveObject.from_wave_file("CRAZYBAZZ.wav")
aud_dx200 = sa.WaveObject.from_wave_file("DX200.wav")
aud_fall = sa.WaveObject.from_wave_file("FALL.wav")
aud_hatz = sa.WaveObject.from_wave_file("HATZZZ.wav")
aud_lun1 = sa.WaveObject.from_wave_file("luny_tunes_LOOP1.wav")
aud_lun2 = sa.WaveObject.from_wave_file("luny_tunes_LOOP2.wav")
aud_risi = sa.WaveObject.from_wave_file("RISIN .wav")
aud_sads = sa.WaveObject.from_wave_file("SADSYNTH.wav")
aud_sick = sa.WaveObject.from_wave_file("SICKDRUMZZ .wav")
aud_subm = sa.WaveObject.from_wave_file("SUBMARINEZZZzz .wav")
aud_whae = sa.WaveObject.from_wave_file("WHA EVER BAZZ .wav")
aud_xoxo = sa.WaveObject.from_wave_file("XOX OFFBEAT.wav")
aud_scra = sa.WaveObject.from_wave_file("scrapple.wav")
while True:
try:
print('\n')
print('\n')
numpla = int(input('number of players: '))
numpli = range(numpla)
break
except:
continue
# creating results-dict and asking no of players and game (301 / 501 / ... )
res = {}
for i in numpli:
name = input('enter player: ')
name = name.upper()
res[name] = []
print('\n')
print('players:',res)
while True:
try:
hint= int(input('enter game: '))
break
except:
print('integers please')
continue
# input loop
i = 1
delete = False
while True:
for name in res:
if delete is True:
i = i - 1
delete = False
break
n = hint - sum(res[name])
while True:
print('\n')
if delete is False:
print(name, '- your turn:', n)
try:
scor = int(input('score: '))
except:
play_obj = aud_whut.play()
print('integers please')
continue
if scor == 1312:
sys.exit()
if scor == 666:
for name in res:
res[name] = res[name][:i-2]
i = i - 1
delete = True
break
if scor > n:
scor = 0
if scor >= 0:
res[name].append(scor)
if scor > 99:
play_obj = aud_lo11.play()
elif scor > 95:
play_obj = aud_fall.play()
elif scor > 90:
play_obj = aud_yeah.play()
elif scor > 82:
play_obj = aud_rhod.play()
elif scor > 77:
play_obj = aud_risi.play()
elif scor > 73:
play_obj = aud_trom.play()
elif scor > 66:
play_obj = aud_dx200.play()
elif scor == 63:
play_obj = aud_lun1.play()
elif scor > 60:
play_obj = aud_loo3.play()
elif scor > 51:
play_obj = aud_meta.play()
elif scor > 47:
play_obj = aud_xoxo.play()
elif scor == 42:
play_obj = aud_lun2.play()
elif scor > 39:
play_obj = aud_hhs1.play()
elif scor > 35:
play_obj = aud_sick.play()
elif scor == 32:
play_obj = aud_subm.play()
elif scor > 30:
play_obj = aud_loo8.play()
elif scor == 25:
play_obj = aud_whae.play()
elif scor == 27:
play_obj = aud_hatz.play()
elif scor > 20:
play_obj = aud_loo2.play()
elif scor > 16:
play_obj = aud_bott.play()
elif scor > 13:
play_obj = aud_craz.play()
elif scor > 10:
play_obj = aud_loop.play()
elif scor > 7:
play_obj = aud_sads.play()
elif scor > 0:
play_obj = aud_sati.play()
elif scor == 0:
play_obj = aud_whut.play()
# play_obj.wait_done()
break
n = hint - sum(res[name])
if n == 0:
time.sleep(5)
play_obj = aud_scra.play()
print('\n')
print('\n')
print('*************', name, 'WON THE GAME *************')
print('\n')
print('\n')
exit = input('press enter to exit game ')
sys.exit()
name = name + 's'
print(name,'new score:', n)
print('\n________________________________________________')
print('\nNEW SCORE AFTER ROUND', i)
print('\n')
for name in res:
print('***', name)
if i != 0:
avg = int(sum(res[name]) / i)
else:
avg = 0
print('***',hint - sum(res[name]),' avg', avg, res[name])
print()
print('________________________________________________')
i = i + 1