-
Notifications
You must be signed in to change notification settings - Fork 207
/
Copy pathWheelOfColors.py
54 lines (38 loc) · 1.47 KB
/
WheelOfColors.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
# Wheel of colors, a game similar to the wheel of fortune,
# Choose a color then spin the wheel,
# And await your destiny
print('''Welcome to the wheel of colors, where you can gamble to your hearts content.
Here, if your first guess is correct, your bet is doubled and returned
If your second guess is correct, your bet is unchanged and returned
''')
import random
# All possible colors
colorsInWheel = ['red', 'yellow', 'blue', 'green', 'orange', 'purple', 'black']
# Amount in purse
purse = 500
while purse > 0:
# Players Guess
guess1 = str(input('Choose one color : '))
guess2 = str(input('Choose another color : '))
# The players bet
bet = int(input('Enter your bet : '))
# The color it lands on
theColor = random.choice(colorsInWheel)
# The Checking system
if guess1 == theColor:
print('Wow! You got it correct! You get', bet * 2, '!')
purse = purse + (bet * 2)
print('''You have', purse, 'in your purse!
''')
elif guess2 == theColor:
print('Wow! You got it correct! You get', bet, '!')
purse = purse + bet
print('''You have''', purse, '''in your purse!
''')
else:
print('Sorry! The color was :', theColor, '. Better luck next time')
purse = purse - bet
print('''You have''', purse, '''in your purse!
''')
else:
print('Sorry! You do not have any money left.')