Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Error?
Old
Ghoku
Junior Member
 
Status: Offline
Posts: 4
Join Date: Sep 2011
Default Error? - 10-14-2011, 05: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.
Attached Files
File Type: a2w final.a2w (6.78 MB, 3 views)
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 10-14-2011, 06:35 PM

That's easy, you forgot to make it so that when you get the question right the variable sets itself to false.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
Ghoku
Junior Member
 
Status: Offline
Posts: 4
Join Date: Sep 2011
Default 10-14-2011, 08:27 PM

What do you mean? If right I set it as true not false.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 10-15-2011, 07: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.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
Ghoku
Junior Member
 
Status: Offline
Posts: 4
Join Date: Sep 2011
Default 10-15-2011, 07:22 PM

Quote:
Originally Posted by DensetsuNoKaboom View Post
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.
Attached Files
File Type: a2w final.a2w (6.92 MB, 0 views)
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.