Wednesday, February 22, 2012

Speed Bingo



*Brushes the Cobwebs off the Desk*

Here's a completely useless, but interesting project I worked on, spurred by a whim. At work they have "Safety Bingo", in which all the employees compete to win a pot, which increases by a dollar each day nobody dies.





The game is fun enough, since there's cash to be won, but I thought that waiting for days on end to see who would win a bingo game could be expedited drastically if the game was played and determined automatically. Indeed, Bingo is, in theory, a game of random chance.

So I made this....thing. I wanted to make something that could play a legitimate game of Bingo with as many players as you wanted. It served as a good way for me to learn how to code classes in Actionscript 3 as well as generate content dynamically based on dynamic circumstances. Still a lot to learn, but every little bit helps.

The three text fields are for the User's....use. The minimum and maximum numbers determine the range of numbers that can appear in the card's boxes. I've set some restrictions, as there has to be at least 5 numbers for each column, to avoid any duplicates, and the floor and roof of those numbers are 10 and 99, mostly cause single and double digit numbers would look bad in the card.

Finally, the number of players can be determined by the User as well. The minimum is 2, since there's no point playing Bingo against yourself. (Wait, isn't that kinda what you're doing?) I don't recommend numbers beyond 50 only because you end up not being able to see anything, but you can conceivably put whatever number you want in there, though if I remember right, I limited the number to 3 digits.

Enjoy!

No comments: