bingo
This is an old revision of the document!
Bingo
It's not just a song from summer camp, its an old-timey game: Here is a Video Explaining the rules
First we will make a BingoCell class, then a BingoCard class, and later we will make a BingoGame class.
The BingoCell
class would be a subclass of Cell that would add the attributes of a number and a font and its own draw method that can draw the number. Here is a hint:
The BingoCard
class will need:
- a 2-D array of BingoCells
- a method that constructs the card so that:
- The “B” column has 5 unique numbers from 1-15
- The “I” column has 5 unique numbers from 16-30
- The “N” column has 4 unique numbers from 31-45, with the center a “Free” cell
- The “G” column has 5 unique numbers from 46-60
- The “O” column has 5 unique numbers from 61-75
- a draw method takes a Graphics parameter to draw the board
- a method 'hasBingo' (that returns a boolean) which detects a win for the rows, columns, and diagonals (later you can overload this with method that takes a parameter for the “blackout,” “corners,” or “box” variants)
bingo.1619884520.txt.gz · Last modified: 2021/05/01 11:55 by frchris