-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslot machine.py
More file actions
132 lines (123 loc) · 3.16 KB
/
slot machine.py
File metadata and controls
132 lines (123 loc) · 3.16 KB
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
#This is a code for a slot machine
#fruits dont work on cmd
#thonny works fine
#made by markthecoderguy on github
import random
import time
coins = 5
score = 0
print ("you have 5 coins")
while coins > 0:
print("coins:")
print(coins)
print("score:")
print(score)
play = (input("INSERT COIN\n "))
pick = random.randint(1,5)
if pick == 1:
print("914")
time.sleep(0.5)
print("🍉🍉🍉")
time.sleep(0.5)
print("🥥21")
time.sleep(0.7)
print("🍒🍒🍒")
time.sleep(1)
elif pick == 2:
time.sleep(0.5)
print("🍒🍒2")
time.sleep(0.6)
print("2🥝0")
time.sleep(0.8)
elif pick == 3:
print("🥝🥝🥝")
time.sleep(0.7)
print("0🥑1")
time.sleep(1)
elif pick == 4:
print("893")
time.sleep(0.4)
print("🍒01")
time.sleep(0.7)
print("🍉🍉7")
time.sleep(1)
elif pick == 5:
print("🍐12")
time.sleep(0.5)
print("🍒🍒🍒")
time.sleep(1)
else:
print("error")
win = random.randint(1,10)
if win == 1:
print("386")
time.sleep(1)
print("no points added! total score:")
print(score)
coins = coins - 1
elif win == 2:
print("962")
time.sleep(1)
print("no points added! total score:")
print(score)
coins = coins - 1
elif win == 3:
print("529")
time.sleep(1)
print("no points added! total score:")
print(score)
coins = coins - 1
elif win == 4:
print("670")
time.sleep(1)
print("no points added! total score:")
print(score)
coins = coins - 1
elif win == 5:
print("406")
time.sleep(1)
print("no points added! total score:")
print(score)
coins = coins - 1
elif win == 6:
print("2🍉0")
time.sleep(1)
print("1 point added! total score:")
score = score + 1
print(score)
coins = coins - 1
elif win == 7:
print("🍒🍒🍒")
time.sleep(1)
print("BIG WIN")
print("5 POINTS ADDED! total score:")
score = score + 5
print(score)
coins = coins - 1
elif win == 8:
print("🍒🍒🍎")
time.sleep(1)
print("small win! 2 points added! total score:")
score = score + 2
print(score)
coins = coins - 1
elif win == 9:
print("🍉2🍉")
time.sleep(1)
print("medium win! 3 points added! total score:")
score = score + 3
print(score)
coins = coins - 1
elif win == 10:
print("🥥67")
time.sleep(1)
print("1 point added! total score:")
score = score + 1
print(score)
coins = coins - 1
else:
print("error")
if coins == 0:
print("NO COINS LEFT")
print("score:")
print(score)