View Single Post
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