Thursday, 2 December 2010

Mathematica Bingo

I've just discovered the command Speak, although it was available in Mathematica 7. After the excitement of listening to my computer reciting silly things like the first 100th digits of π, I wondered what I could do with Speak that would be useful. What I came up with is a Bingo machine - sort of useful.

Here’s what the machine looks like:


Download and run the notebook to hear the numbers as you draw them.

The code for this applet is divided into three functions. The first one initializes the set of numbers to draw (all the usual Bingo numbers) and the set of numbers drawn so far (empty set to begin with):


The second one implements a random draw in the set of numbers that remain:


The third function displays in a neat way the drawn and un-drawn numbers:


The remaining bits of code that use these functions to generate the Bingo machine can be found here. Download it and run it in Mathematica or Mathematica Player to listen to your very own Bingo master!

No comments:

Post a Comment