/
main.py
93 lines (75 loc) · 3 KB
/
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
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
from time import sleep
from app.account import Account
from app.modu import clear, intro, helper
from app.games import pick_a_card, cho_han, slot, roulette, blackjack
acc = Account()
games = ['Card Game', 'Cho-han', 'Roulette', 'Blackjack', 'Slots']
intro()
while True:
user_input = input('>> ')
#Settings and general options
if user_input.lower() == 'games':
print()
for g in games:
print(g)
sleep(0.4)
print()
if user_input.lower() == 'clear':
clear()
if user_input.lower() == 'help':
helper()
if user_input.lower() == 'exit':
break
#Games
if user_input.lower() == 'dice' or user_input.lower() == 'chohan' or user_input.lower() == 'cho-han' or user_input.lower() == 'cho':
bet = input(f'How much to bet>> ')
choice = input(f'Do you bet on odd or even? ')
game = cho_han(bet, choice)
acc.money += int(game)
if user_input.lower() == 'card' or user_input.lower() == 'card games':
bet = input(f'How much to bet>> ')
game = pick_a_card(bet)
acc.money += int(game)
if user_input.lower() == 'blackjack':
pass
if user_input.lower() == 'slot' or user_input.lower() == 'slots':
bet = input(f'How much to bet>> ')
game = slot(bet)
acc.money += int(game)
if user_input.lower() == 'roulette' or user_input.lower() == 'roulete':
bet = input(f'How much to bet>> ')
choice = input(f'Do you bet on odd or even or a number? ')
game = roulette(bet, choice)
acc.money += int(game)
if user_input.lower() == 'blackjack' or user_input.lower() == 'black' or user_input.lower() == '21':
bet = input(f'How much to bet>> ')
game = blackjack(bet)
acc.money += int(game)
#Account and loans options
if user_input.lower() == 'account' or user_input.lower() == 'balance':
acc.complete_acc()
if user_input.lower() == 'take loan':
amount = input(f'You can take a loan up to: {acc.max_loan}\nAmount?>> ')
try:
acc.take_loan(int(amount))
print(acc.check_loan())
except ValueError:
print(f'Please specify the amount.\n{amount} is not a recognized value')
if user_input.lower() == 'pay loan':
amount = input(f'Your debt is: {acc.loan}\nAmount to pay?>> ')
try:
acc.pay_loan(int(amount))
print(acc.check_loan())
except ValueError:
print(f'Please specify the amount.\n{amount} is not a recognized value')
# Test game to delete after
if user_input.lower() == 'test':
while True:
bet = input(f'How much to bet>> ')
choice = input(f'even or odd?\n>> ')
if choice == 'odd' or choice == 'even':
game = cho_han(bet, choice)
acc.money += int(game)
cont = input('Continue?(y/n)\n>> ')
if cont.lower() == 'n':
break