Re: Simple Coin toss program

Steve Thomas <sthomas1-gQhbkF4bah9Wk0Htik3J/[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.squeakland
Message-ID <CAGa9PAYJbX1oo03B--94ZsG32gpxh2iQpUXovoJL7zc7bQ1v8w@mail.gmail.com>
I made a Coin Toss
project<http://www.squeakland.org/showcase/project.jsp?id=11342>that
starts with an Etoys challenge for you to build your own coin toss
race. You could ask kids what to run a bunch of races, compare results and
if they noticed anything about the way the coins move.

I also played around with how to help folks find certain tiles on page 2
using Event Theatre. The problem with this approach is it doesn't work when
you switch languages (because it records mouse position)  Would be nice to
have some way to add a "how to find this tile" mechanism, for etoys
challenges and for folks looking at other peoples scripts. Perhaps an
<alt><click> to help show where to find it.

Also on the last page is a visual that you can "scroll" to see the pattern
of heads/tails.  It broke down when I made the playfield length ~10,000 (the
stamped, images re-arranged when I started scrolling.

Stephen



On Tue, Oct 11, 2011 at 1:02 PM, R.D. Latimer <[email protected]> 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.
>
> 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
> results.
>
> 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,
> Randy Latimer
>
>
> _______________________________________________
> squeakland mailing list
> [email protected]
> http://lists.squeakland.org/mailman/listinfo/squeakland
>
>

_______________________________________________
squeakland mailing list
[email protected]
http://lists.squeakland.org/mailman/listinfo/squeakland
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.