alice-teacher random number question
James Caristi
James.Caristi at valpo.edu
Mon Nov 1 12:30:26 EDT 2010
At the beginning of your method, you can declare a "local" variable by using the "Create new variable" button. Make it numeric and give it a name (say, "number"). Then drag it into the programming part. This will give you a chance to set it however you want. Here is where you can give it a random value. Then you can print it and do whatever else you want with it. Good luck.
Jim
James Caristi
Dept. of Math & Computer Science
Valparaiso University
Valparaiso, IN 46383
>>> Ella Glazer <ella.glazer at gmail.com> 11/1/2010 11:13 AM >>>
Is there any way to show a random number?
I am trying to play a simple game with random numbers and I would like to know what is coming up. The number (0 - 100) most of the time is less than 5. Attached is the code. If the number <5 (should actually be <50) the cow is appears green else the cow is blue.
What am I doing wrong?
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20101101/8f6b80f8/attachment.html
More information about the alice-teachers
mailing list