Saturday, October 2, 2010

Just Basic High Speed Calculations

This morning I wrote my own response to Alfred Thompson's question. I posed his question to my computer programming class last week. They successfully established the two arrays to populate two imaginary card decks but ran out of time before tackling the actual comparison of random card selection.

I actually have another version that replicates the player experience but I like this program because it actually provides the data needed to make a decision. I plan to point out to the class that the benefit of using a computer is that we can run multiple simulations in a fraction of the time a real game would take.

In fact, this morning I set it to run 10,000 games. It was done before I came back with a fresh cup of coffee. Of course, I plan to guide them through the completion of their own program before revealing mine. Which illustrates my second major teaching point: there isn't always one right answer.

download the game code