Welcome to a number guessing game. I am thinking of a number between 1 and 100. You will be asked to guess it. I will tell you if your guess is higher or lower than the number I've chosen. You win by guessing my number! You only get three guesses.
[[Make first guess]](set: $num to (random:0,100))
(set: $count to 0)(set: $guess to (prompt:"What is your guess?", "65"))
Your guess is: $guess
[[Is your guess correct?]](if: $guess is false)[Your [[Guess is not correct]].]
(if: $guess is $num)[ Your[[guess is correct]].]
(if: $guess > $num)[Your number is too high.]
(if: $guess < $num)[Your number is too low.]
[[Would you like to try again?->Make first guess]]
(set: $count to it +1)
(if: $count is 3)[You have ran out of [[tries]].]Hi, I hope you got my email. If not...I would check there first.
If you have read my email, then you know I am struggling. This set of coding is not easy to understand for me.
I do not think that I am correctly understanding how to make a loop. I know I made a loop, but I don't think that it is right.
I also am getting errors that my codes do not exist. Which I just don't understand the codes well. Where am I messing up?
After that I feel like I am going to run into the problem that if they continue to guess that the code will not be correct. That it will save the number the first time that they guess again, but possibly not the second.
I think I understand how to get out of the loop. Or I set that up correctly, but I am not sure how to set the players number equal to the one that is randomly selected.
I won't lie. I am pretty frustrated, but I just cannot figure out how to fix it. I hope you understand. I don't mind if I get a bad grade, I just want to understand.
Morgan GraceYou have won the game.
[[Would you like to play again?->Start]][[Would you like to play again?->Start]]