Reorganising
This commit is contained in:
13
BlackJack.py
13
BlackJack.py
@@ -147,13 +147,10 @@ class BlackJack:
|
||||
while not gameOver:
|
||||
playerWinState = self.checkHandState(self.playerHand)
|
||||
dealerWinState = self.checkHandState(self.dealerHand)
|
||||
gameOver = self.checkGameOver(playerWinState)
|
||||
gameOver = self.checkGameOver(playerWinState) or self.checkGameOver(dealerWinState)
|
||||
if gameOver:
|
||||
continue
|
||||
gameOver = self.checkGameOver(dealerWinState)
|
||||
if gameOver:
|
||||
continue
|
||||
|
||||
|
||||
await self.send("Players hand = " + str(getHandTotal(self.playerHand)) + ": " + handNumbersToCards(
|
||||
self.playerHand) + "\n" + "Dealers hand = ??: " + convertNumberToCard(self.dealerHand[0]) + "??")
|
||||
play = await self.recv("Hit or Stand? (h/s)")
|
||||
@@ -167,8 +164,7 @@ class BlackJack:
|
||||
playerStood = True
|
||||
|
||||
playerWinState = self.checkHandState(self.playerHand)
|
||||
gameOver = self.checkGameOver(playerWinState)
|
||||
if gameOver:
|
||||
if self.checkGameOver(playerWinState):
|
||||
continue
|
||||
|
||||
# Dealers turn
|
||||
@@ -184,8 +180,7 @@ class BlackJack:
|
||||
self.hit()
|
||||
dealerWinState = self.checkHandState(self.dealerHand)
|
||||
|
||||
gameOver = self.checkGameOver(dealerWinState)
|
||||
if gameOver:
|
||||
if self.checkGameOver(dealerWinState):
|
||||
continue
|
||||
|
||||
await self.send("Players hand = " + str(getHandTotal(self.playerHand)) + ": " + handNumbersToCards(self.playerHand) +
|
||||
|
||||
Reference in New Issue
Block a user