Standing bug should be fixed

This commit is contained in:
2023-02-12 19:02:22 +10:00
parent 569a32660a
commit 7551d9b63b
2 changed files with 6 additions and 2 deletions

View File

@@ -135,9 +135,7 @@ class BlackJack:
return gameOver
async def play_game(self, ID, bet, recv, send):
validInput = False
gameOver = False
playerStood = False
playerStats = self.ledger.readLedger(ID)
if playerStats is None:
self.ledger.writeLedger(ID)
@@ -145,6 +143,10 @@ class BlackJack:
self.deal()
while not gameOver:
play = None
playerStood = False
validInput = False
playerWinState = self.checkHandState(self.playerHand)
dealerWinState = self.checkHandState(self.dealerHand)
gameOver = self.checkGameOver(playerWinState) or self.checkGameOver(dealerWinState)
@@ -157,9 +159,11 @@ class BlackJack:
while not validInput:
if play == "h":
self.hit()
print(f"Hit {self.playerTurn}")
validInput = True
elif play == "s":
self.stand()
print(f"stood {self.playerTurn}")
validInput = True
playerStood = True