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:
|
while game.active:
|
||||||
ui.update(game)
|
ui.update(game)
|
||||||
|
for player in game.players:
|
||||||
|
if player.blackjack(game):
|
||||||
|
game.active = False
|
||||||
|
|
||||||
if game.active:
|
if game.active:
|
||||||
match ui.player_move(deck).lower():
|
match ui.player_move(deck).lower():
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
Need Python >= 3.10
|
||||||
```
|
```
|
||||||
.oPYo. 8 8 o 8
|
.oPYo. 8 8 o 8
|
||||||
8 `8 8 8 8 8
|
8 `8 8 8 8 8
|
||||||
|
|
|
@ -6,6 +6,7 @@ class GameMaster:
|
||||||
self.players = [Player('Dealer'), Player('Player')] # 5-9 seats
|
self.players = [Player('Dealer'), Player('Player')] # 5-9 seats
|
||||||
self.dealer = self.players[0]
|
self.dealer = self.players[0]
|
||||||
self.player = self.players[1]
|
self.player = self.players[1]
|
||||||
|
self.blackjack = False
|
||||||
|
|
||||||
def score(self):
|
def score(self):
|
||||||
status = 'Error'
|
status = 'Error'
|
||||||
|
@ -26,6 +27,7 @@ class GameMaster:
|
||||||
status = player.name + ' Bust!'
|
status = player.name + ' Bust!'
|
||||||
elif player.blackjack(self):
|
elif player.blackjack(self):
|
||||||
self.active = False
|
self.active = False
|
||||||
|
self.blackjack = True
|
||||||
status = player.name + ' has Blackjack!'
|
status = player.name + ' has Blackjack!'
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
|
@ -92,9 +92,12 @@ o8YooP' 8 .oPYo. .oPYo. 8 .o 8 .oPYo. .oPYo. 8 .o
|
||||||
|
|
||||||
def update(self, game):
|
def update(self, game):
|
||||||
print(self.clear + self.title +
|
print(self.clear + self.title +
|
||||||
self.show_players(game) +\
|
self.show_players(game))
|
||||||
('\n'+game.score() if not game.active else ''))
|
for player in game.players:
|
||||||
|
if player.blackjack(game):
|
||||||
|
game.active = False
|
||||||
|
if not game.active:
|
||||||
|
print(game.score())
|
||||||
def get_decks(self):
|
def get_decks(self):
|
||||||
return input('How many decks? (1-8): ')
|
return input('How many decks? (1-8): ')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue