User Tools

Site Tools


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

The BingoCard class will need:

  1. a 2-D array of BingoCells
  2. a method that constructs the card so that:
    1. The “B” column has 5 unique numbers from 1-15
    2. The “I” column has 5 unique numbers from 16-30
    3. The “N” column has 4 unique numbers from 31-45, with the center a “Free” cell
    4. The “G” column has 5 unique numbers from 46-60
    5. The “O” column has 5 unique numbers from 61-75
  3. a toString method that has no parameters, and returns a string representation of the board that is similar to :
  4. a draw method takes a Graphics parameter to draw the board
  5. 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.1619881345.txt.gz · Last modified: 2021/05/01 11:02 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki