View Full Version : setting the distance by asking the user

03-10-2014, 11:15 AM
I am doing Alice assignment Lab 1 and, I have to pick a hopping animal and have him hop by the distance asked by the user. The only trouble I am having is letting the user set how far the animal can walk. I used a kangaroo by the way. Can someone please help me? Thank you.

03-11-2014, 07:56 PM
1) Create a numeric variable.
2) Drag a "set variable value" into you main program, and set it to "1".
3) Click on World functions, and drag a "Ask user for a number" into the "1".
4) Create a numeric "parameter" in your hop routine.
5) pass the outside variable name in as a parameter when calling your the hop routine.

03-12-2014, 01:41 PM
It worked, Thank you for your help.

03-27-2014, 12:38 PM
I had a little trouble with this also. I followed the tutorial on variables and functions and was able to get it to work. I also used the example in the book about a hopping frog. I used the roo for this assignment also.