+ 1

Why does my programm run continouosly?

HY Guys, I want to play my game again if I type y or Y in the console but if I do that the programm wont stop to run, how can I fix that? https://code.sololearn.com/cV4aM2V1ZK0U/?ref=app https://code.sololearn.com/cV4aM2V1ZK0U/?ref=app

12th Apr 2019, 9:44 PM
Kevin
Kevin - avatar
3 Respostas
+ 1
Remove AskToPlayAgain() from the loop. Then, inside the while condition, change AskToPlayAgain to AskToPlayAgain() with parentheses: } while (AskToPlayAgain());
13th Apr 2019, 5:13 AM
Zeke Williams
Zeke Williams - avatar
0
What do you mean wont stop to run, could you explain what is the expected behaviour that you want ? Because from what i see the program will ask you if you want to play again each time you complete the game
12th Apr 2019, 11:24 PM
bxhd
0
bxhd I mean if I type yes for playing again the programm it goes crazy
13th Apr 2019, 8:29 AM
Kevin
Kevin - avatar