random numbers in etoys

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

random numbers in etoys

Christian Grune
how do I assign a random numer (a number between a given min & max) to a
variable?
Couldn't find any tile in the viewer for that....

Wie kann ich Zufallszahlen einer Variable zuweisen?? Es scheint keine
Kacheln im Betrachter dafür zu geben....

Thanks, Christian Grune


Reply | Threaded
Open this post in threaded view
|

Re: [Squeakland] random numbers in etoys

Alan Kay
If the variable is called "car's foo", the min is 6 and the max is 17, then
how about

            car's foo <- 6 + random 17
?

I'm not sure what version you are using, but you can find the random tile
in every scriptor's menu, and very often there is one in the Supplies bin.

Cheers,

Alan

At 01:51 PM 7/18/2005, Christian Grune wrote:

>how do I assign a random numer (a number between a given min & max) to a
>variable?
>Couldn't find any tile in the viewer for that....
>
>Wie kann ich Zufallszahlen einer Variable zuweisen?? Es scheint keine
>Kacheln im Betrachter dafür zu geben....
>
>Thanks, Christian Grune
>
>_______________________________________________
>Squeakland mailing list
>[hidden email]
>http://squeakland.org/mailman/listinfo/squeakland



Reply | Threaded
Open this post in threaded view
|

Re: random numbers in etoys

Markus Schlager-2
In reply to this post by Christian Grune
> Wie kann ich Zufallszahlen einer Variable zuweisen?? Es scheint keine Kacheln
> im Betrachter dafür zu geben....

Eine Kachel f"ur Zufallszahlen findet sich z.B. im 'Lager' beim
Squeakland-Image oder im Objektkatalog unter 'Skriptfenster'.

-----------------------------------------------
 Markus Schlager                  [hidden email]