PDA

View Full Version : Error?


Ghoku
10-14-2011, 06:14 PM
Ok so I have a problem. I want to make it so that it asks you a question, if you answer it right then it will ask another question and if wrong then it will stay on the same question but you will have to restart from the first.

So I created 6 variables for 6 different questions. Set all to false. Then while statement i put "not [World.Question1]" then the if else statement. On the first one I put "IF ask user for a string "Question==answer"" then do something. Else say "Wrong answer" and set the rest of the variables to try.

Oh also I set the variable in the world to false.

So Next question same thing etc.

But for some reason the first question works fine but it doesnt popup the next question.

I added it as a attachment if someone wants to see it.

DensetsuNoKaboom
10-14-2011, 07:35 PM
That's easy, you forgot to make it so that when you get the question right the variable sets itself to false.

Ghoku
10-14-2011, 09:27 PM
What do you mean? If right I set it as true not false.

DensetsuNoKaboom
10-15-2011, 08:01 AM
Your While loop says "While not world.Questions1", so it'll do the method while Questions1 is false. You're right; When you get the question right you should have it set the variable to true, not false. My bad.

Ghoku
10-15-2011, 08:22 PM
Your While loop says "While not world.Questions1", so it'll do the method while Questions1 is false. You're right; When you get the question right you should have it set the variable to true, not false. My bad.

It's ok. I have got it. If you want to look at the code I have added the finished attachment.