Slightly different but seems to work

image

I put the “while” before “PlayAgain”
actually using “PlayAgain” as the Boolean.
it does work , but will this cause errors later on?

This discussion says it's fine,  I was wondering that myself. 

Is there a reason for the extra boolean variable? does that practice come in handy later on?

With out seeing exactly what PlayAgain() does it’s hard to say for sure. But in general, if you’re just prompting the user if they’d like to play again then this approach makes a lot of sense and is common practice.

Privacy & Terms