PDA

View Full Version : setting the distance by asking the user


Sharris
03-10-2014, 10: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.

MrMoke
03-11-2014, 06: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.

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

levimrj
03-27-2014, 11:38 AM
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.