-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (40 loc) · 1.29 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
from player import Player
from table import Table
if __name__ == '__main__':
player1 = Player("Player1")
player2 = Player("Player2")
table = Table()
table.list_of_players = Player.plist
Status = True
while Status:
if table.deck == []:
table.score(Player.plist)
table.dealTable()
a = 3
table.deal()
while a >= 0:
for p in Player.plist:
print("Table")
print(table.on_table)
print("\n")
print("Player", Player.plist.index(p)+1,"Hand")
print(p.hand)
print("\n")
p.play(table)
print("Table")
print(table.on_table)
print("\n")
print("Player", Player.plist.index(p)+1,"Hand")
print(p.hand)
print("\n")
print("Player", Player.plist.index(p)+1,"off_Hand")
print(p.off_hand)
print("\n")
a -= 1
for player in Player.plist:
if player.score >= 21:
print(f"The game is over winner is {player.name}")
Status = False
print("Results")
for player in Player.plist:
print(player.name , player.score)