I have this file which I've created via the Jupiter Notebook. It's a simple game of Blackjack. The first cells are used to create classes and functions. The last includes the game logic (which is also explained at the top level of the notebook document).
At the end of each round, the player is asked if it wants to play again. If not the game is over. If yes, it'll keep going in a loop until the player says no. The issue that I am encountering is that sometimes (and to my eyes, it seems random), at the end of a round, the player isn't asked if it wants to carry on playing but rather everything stops. I can't seem to understand why.
My take is that it seems that the issue lies with the flow, at the level of where the game logic comes together (last cell) where there are x2 blocks of "if" statements succeeding each other on the same indentation level within a while loop. Please help.
Reference: if player.value <= 21: etc if yes_no():
Aucun commentaire:
Enregistrer un commentaire