[squeakland] Simple Coin toss program
rdlatimer at gmail.com
Tue Oct 11 13:02:09 EDT 2011
Hi- trying to simulate a coin toss. I'm putting two objects in a holder - a
circle and a star.
I created two variables in the Holder, circleCounter and starCounter (one
for heads, one for tails)
I assign the cursor of the Holder a random 1 or 2.
I don't know how to check the position of the cursor. The simplest way
would just be:
Test if cursor value == 1...
but I don't see that as a menu option.
So I'm trying:
Test if graphic at cursor == Circle ... How do I do this - check the value
of the graphic or item at the cursor in a holder?
The default value for "Test Holder's graphic at cursor..." is neither the
circle or the star, how do I insert either of those two
images into the Test?
Or can I just test the value of the cursor somehow? (Is it a 1 or a 2)
By the way, I've done this in Scratch, it seems easier to put together
initially, but the speed is an issue.
For alot of 'spins' - like 1000 or more, it may take in terms of minutes to
finish. I think Etoys will be faster.
Also - can I output the results to a data file? It'd be nice to graph the
In Scratch, I put the results into data lists, these can be exported to .txt
files with a right click on the list.
Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the squeakland