Re: Simple Coin toss program
Yoshiki Ohshima <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.squeakland |
|---|---|
| Message-ID | <m239ezo3qv.wl%[email protected]> |
At Tue, 11 Oct 2011 13:02:09 -0400, R.D. Latimer wrote: > > 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. In the Holder's Viewer, there is a category called "collections" and there is a tile called "Holder's cursor". If you drop it to the Test part of test, you get the comparison there and you can change '>' to '='. -- Yoshiki