Help with Crait's random number guessing game [SOLVED]


(Catriona) #1

Hi folks.

i’m pulling my hair out trying to compile the code in Crait’s lesson 4, random guessing game.

It keeps telling me it expects a “}” before my else statement but i’ve gone through the whole code and the brackets are correct. This is the else that goes with the second if statement in the image below.

Even though I think i’m correct, I put in in anyway and I get the next error:

which I know is because I put the “}” in where it told me to, but this closed out my first IF statement and it means my later “}” closes out my void loop () before my last else statement.

So what the HECK is going on?!? I can’t seem to do anything that lets it compile without errors and i’ve checked it over and over and the code looks the same as the structure in the tutrorial.

HELP! :unamused:


(Catriona) #2

sorry folks! I saw the problem 5 seconds after posts. I had a “;” at the end of my IF statement. D’Oh! :crazy_face:


(Kea Oliver) #3

Don’t worry, i solve a ton of problems by writing them out and then going “oh wait duh”


(Pharap) #4

Protip: buy a rubber duck. :P


(Kea Oliver) #5

I talk to my cat, he and I have solved MANY problems together