Since My last post I have gotten the Y/N prompt to work… for the most part (above image).
If the keystroke is “Y” then the value returns true. If keystroke “N”, it returns false. Any other character will cause the question to be re-asked.
NOTE:My initial test of this function used a simple return 0 with the text displayed according to what was pressed. The std::cout is just a remnant of that
The problem lies in the calling the game to play again.
Second image shows my INT MAIN() function. Going down to line 297 is where the game leads you to the Game complete screen, and somewhere in here is where I believe the problem is. For some reason (and what I am hoping the community can point to) I cannot get the game to start over.
My thought process was / is as follows:
-
Make a variable to hold the value of the PlayAgain() function.
-
Run the GameCompleteOutro() function.
-
Run PlayAgain() function. This should carry the value of the bool PlayAgain(bool surveySays) turning it over toPlayAgain(RoundTwo). Which in turns get tucked into the local variable bool RoundTwo.
-
If statement to check whether RoundTwo is true or false and run the code accordingly. If true the goto gameStart; , located near the top of main() function, kicks off the whole game over. If false the game exits to the command line. This worked before and is still working within the bool PlayAgain() function for the pressing something other than y/n so I really don’t think this is wrong either.
I just don’t see where I am going wrong. Any solutions would be appreciated. I want to get this down before I start randomzing the numbers…
-C