I changed the identifiers to English so it can be easily understood on Code Review. I used refactor so it changes everywhere instantly but that\'s when it went wrong. My code do
To play the game again:
When the user press Y, you are calling return
, which exits the function.
You could just put an infinite loop (like while(true)
) wrapping the code from int gameNumber = generator.Next(1, 100);
to the end, then change that return
to a break
.
That will exit the inner loop and go back to the new one, thus generating a new number and starting all over again.