new shit has come to light, man

This commit is contained in:
Adam 2022-12-29 22:27:38 -05:00
parent fb2e4040db
commit 8af654353b
4 changed files with 12 additions and 3 deletions

View file

@ -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():

View file

@ -1,3 +1,4 @@
Need Python >= 3.10
```
.oPYo. 8 8 o 8
8 `8 8 8 8 8

View file

@ -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

View file

@ -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): ')