Standing bug should be fixed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user