Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Strings and numbers
Old
sankia
Guest
 
Status:
Posts: n/a
Default Strings and numbers - 04-01-2009, 07:49 AM

Hi everyone =)

I'm doing a project on Alice and I'm making a sort of maths quiz. I'm fairly new at it so I was wondering if anyone can help me.

I'd like to have an object ask the user a string in which they would ask a maths problem. The user would then reply with the answer and be told if they're right or wrong. I can't figure out how to write if the answer is correct. Can anyone help me?
   
Reply With Quote
Old
draikon3
Guest
 
Status:
Posts: n/a
Default 04-01-2009, 09:11 AM

maybe this is something you may be looking for?
Attached Files
File Type: a2w math problem.a2w (535.1 KB, 21 views)
   
Reply With Quote
Old
sankia
Guest
 
Status:
Posts: n/a
Default 04-02-2009, 10:09 AM

Thanks for the reply =)

I'm still having some trouble though.
If the user got the answer wrong how would I loop the question until correct?
   
Reply With Quote
Old
Scott300
Senior Member
 
Status: Offline
Posts: 80
Join Date: Feb 2009
Location: Ohio
Default 04-02-2009, 10:14 AM

If they get the answer wrong just reset any varables you may have set to there defults and call the first method again.
  Send a message via AIM to Scott300 Send a message via MSN to Scott300  
Reply With Quote
Old
sankia
Guest
 
Status:
Posts: n/a
Default 04-02-2009, 08:42 PM

I just put it in a while loop and told it if hte answer wasn't equal to what I set it as to repeat it.

But now it won't seem to accept any double digit number I enter? Sorry for asking so many questions it just gets really frustrating when you can't firgure it out after hours of trying ><
   
Reply With Quote
Old
draikon3
Guest
 
Status:
Posts: n/a
Default 04-03-2009, 08:47 AM

Here ya go, i think i got it to work how you want
Attached Files
File Type: a2w math problem.a2w (540.6 KB, 21 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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.