Standing bug should be fixed
This commit is contained in:
@@ -135,9 +135,7 @@ class BlackJack:
|
|||||||
return gameOver
|
return gameOver
|
||||||
|
|
||||||
async def play_game(self, ID, bet, recv, send):
|
async def play_game(self, ID, bet, recv, send):
|
||||||
validInput = False
|
|
||||||
gameOver = False
|
gameOver = False
|
||||||
playerStood = False
|
|
||||||
playerStats = self.ledger.readLedger(ID)
|
playerStats = self.ledger.readLedger(ID)
|
||||||
if playerStats is None:
|
if playerStats is None:
|
||||||
self.ledger.writeLedger(ID)
|
self.ledger.writeLedger(ID)
|
||||||
@@ -145,6 +143,10 @@ class BlackJack:
|
|||||||
|
|
||||||
self.deal()
|
self.deal()
|
||||||
while not gameOver:
|
while not gameOver:
|
||||||
|
play = None
|
||||||
|
playerStood = False
|
||||||
|
validInput = False
|
||||||
|
|
||||||
playerWinState = self.checkHandState(self.playerHand)
|
playerWinState = self.checkHandState(self.playerHand)
|
||||||
dealerWinState = self.checkHandState(self.dealerHand)
|
dealerWinState = self.checkHandState(self.dealerHand)
|
||||||
gameOver = self.checkGameOver(playerWinState) or self.checkGameOver(dealerWinState)
|
gameOver = self.checkGameOver(playerWinState) or self.checkGameOver(dealerWinState)
|
||||||
@@ -157,9 +159,11 @@ class BlackJack:
|
|||||||
while not validInput:
|
while not validInput:
|
||||||
if play == "h":
|
if play == "h":
|
||||||
self.hit()
|
self.hit()
|
||||||
|
print(f"Hit {self.playerTurn}")
|
||||||
validInput = True
|
validInput = True
|
||||||
elif play == "s":
|
elif play == "s":
|
||||||
self.stand()
|
self.stand()
|
||||||
|
print(f"stood {self.playerTurn}")
|
||||||
validInput = True
|
validInput = True
|
||||||
playerStood = True
|
playerStood = True
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user