We have made a robot of guessing number.We want to count the number of the guesses per player,what should I do?
Hi @YI_LI_WU,
Based on the information provided, let’s assume you’ll input the number of players who will be participating in the game. You can then dynamically create either a Dictionary or an Integer Array, where the size corresponds to the number of players. Initialize all the values (or indexes) to 0.
Each player will take turns sequentially. Every time it’s a player’s turn, you’ll increment their value in the array or dictionary by 1. The process continues like this, looping through each player, until someone guesses the correct number.
Once a player guesses the number, you can stop the process and determine the winner.
Hope this helps! ![]()
ok!thank you for your answer!
Happy to help, please mark as solution, Thank You! ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.