new shit has come to light, man
This commit is contained in:
parent
fb2e4040db
commit
8af654353b
4 changed files with 12 additions and 3 deletions
|
@ -18,6 +18,9 @@ def main():
|
|||
|
||||
while game.active:
|
||||
ui.update(game)
|
||||
for player in game.players:
|
||||
if player.blackjack(game):
|
||||
game.active = False
|
||||
|
||||
if game.active:
|
||||
match ui.player_move(deck).lower():
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
Need Python >= 3.10
|
||||
```
|
||||
.oPYo. 8 8 o 8
|
||||
8 `8 8 8 8 8
|
||||
|
|
|
@ -6,6 +6,7 @@ class GameMaster:
|
|||
self.players = [Player('Dealer'), Player('Player')] # 5-9 seats
|
||||
self.dealer = self.players[0]
|
||||
self.player = self.players[1]
|
||||
self.blackjack = False
|
||||
|
||||
def score(self):
|
||||
status = 'Error'
|
||||
|
@ -26,6 +27,7 @@ class GameMaster:
|
|||
status = player.name + ' Bust!'
|
||||
elif player.blackjack(self):
|
||||
self.active = False
|
||||
self.blackjack = True
|
||||
status = player.name + ' has Blackjack!'
|
||||
|
||||
return status
|
||||
|
|
|
@ -92,9 +92,12 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
|
|||
|
||||
def update(self, game):
|
||||
print(self.clear + self.title +
|
||||
self.show_players(game) +\
|
||||
('\n'+game.score() if not game.active else ''))
|
||||
|
||||
self.show_players(game))
|
||||
for player in game.players:
|
||||
if player.blackjack(game):
|
||||
game.active = False
|
||||
if not game.active:
|
||||
print(game.score())
|
||||
def get_decks(self):
|
||||
return input('How many decks? (1-8): ')
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue