I’m currently on Lecture 27, and everything is going great. Until I started to wonder, how the heck my code is working. I feel like it’s out of order, and I’m not sure why it plays the way it does.
This is my first time using Gist and I didn’t copy over my header or another .cpp I have so it probably doesn’t work, but I’m mostly confused just by the order in which the code is set up, but why it still plays out in the correct order.
So at this point, I start up the program.
It welcomes with the intro.
It asks for your guess.
It repeats back your guess.
And it is specifically here I get confused, because the order in my code is showing PlayGame with the output for "Your guess was: " as being immediately after the intro, but instead the string GetGuess outputs.
To clarify, it LOOKS to me as if the game should:
Welcome with the intro
"Your guess was: "
Ask for your guess
But it works as it’s supposed to, which is why I am so confused.
I’ve pretty much been following along and trying to internalize as much as I can remember, but when I took a second look, I’ve simply gone and confused myself. Figured it’d be better to figure it out now though, haha.
Thank you!