-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
42 lines (38 loc) · 979 Bytes
/
main.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
from yahtzee import Yahtzee
from poker import Poker
from blackjack import Blackjack
players = None
choice = None
while players == None:
try:
print("How many players?")
players = int(input(" > "))
except ValueError:
print("Invalid number.")
if players == 0:
print("No.")
players == None
while choice != 0:
print("Select a Game: ")
print(" 1 - Blackjack")
print(" 2 - Poker")
print(" 3 - Yahtzee")
print(" 0 - Exit")
try:
choice = int(input(" > "))
except ValueError:
print("That is not a valid input. Please try again.")
continue
if choice == 0:
print("Goodbye.")
elif choice == 1:
Blackjack(players)
elif choice == 2:
if players < 3:
print("Two few players.")
continue
Poker(players)
elif choice == 3:
Yahtzee(players)
else:
print("That is not a valid input. Please try again.")