Unreal Course do while. Simplified?

At the end of the do while loop tutorial the code looks like this:

bool bPlayAgain = false;
do {
PrintIntro();
PlayGame();
bPlayAgain = AskToPlayAgain();
}
while (bPlayAgain);

But here is my question, isn’t it simplier to make the code like this: ?

do {
printIntro();
playGame();
}
while (askToPlayAgain());

Yes, it is.

Thank you :slight_smile:

what about my solution? it seems to work just as well…although i am new to c++ and have much more experience with python.

Privacy & Terms