Hey there,
I’ve had a pretty good understanding of the videos thus far, but the Boolean concept has thrown me for a loop. In this specific lesson, I don’t understand the meaning of: bool bPlayAgain = false
I understand a do while loop, but I’m not sure what the purpose of bPlayAgain is. We specify that bPlayAgain = AskToPlayAgain(); , why not write:
bool bAskToPlayAgain = false
do
{
PrintIntro();
PlayGame():
bAskToPlayAgain();
}
while (bAskToPlayAgain)
Is it because bAskToPlayAgain(); is not a function previously defined? Furthermore, why is it bool bPlayAgain=false and not =true? If the value returned from AskToPlayAgain is y, y=0, and 0=true, shouldn’t it be = true?
I apologize if this isn’t the most structured question, but I’d really like to get Boolean concepts nailed down before I continue. I appreciate any explanation you’re able to give me, thank you!
EDIT: Using the code created in this lesson, I changed bPlayAgain = false; to = true; and it functions exactly the same. I am quite confused. Please send help.