Alice Community  

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

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Ask user for a 2-digit Number?
Posts: n/a
Question Ask user for a 2-digit Number? - 02-23-2009, 10:49 AM

Attempting to answer jaydenb's question on asking the user for an age, I stumbled across a problem. To ask for a user's age, one should supposedly be able to make a number variable in the world, then, under my first method, set the value to (ask user for a number)[function]. However, apparently, the user can only enter single digit numbers. If you enter a double digit number, the number variable is set to 0.

Why is this? Is a two-digit number not considered a number? And finally, is there a way to ask the user to input a two digit number?

I have attached the world I was working on, to make it more clear. If you press Play, and enter a two digit-number when it asks for your age, it gives the age as 0. Further down, I experimented with using separate variables for each digit, but that is very cumbersome, and doesn't work if you want to work with the entire age value.
Attached Files
File Type: a2w StringTut.a2w (398.2 KB, 21 views)
Reply With Quote

number, question, string, user

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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.