The request
“Pseudocode for a 31 counting game: start with count zero, each player says one to three numbers and adds them to the count, lose when the count reaches 31, otherwise move to the next player's turn and repeat.”
Then tryAdd a maximum of two numbers per turn.Add a winning message for the other player.
What is in this drawing
Read the decisions behind it.
01
Determining whose turn it is after each move
02
Checking if the count has reached 31 to declare a loser
Use this flowchart to teach beginners how to play the Baskin Robbins 31 game or as a guide for analyzing the game's strategy.
More like this