java.lang.Objectedu.kzoo.grid.Grid
edu.kzoo.grid.BoundedGrid
BingoCard
public class BingoCard
Bingo Game:
A BingoCard object represents a card with random numbers (but no
duplicates) that can be used for a game of bingo.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class edu.kzoo.grid.BoundedGrid |
---|
edu.kzoo.grid.BoundedGrid.Array2DGridRep |
Nested classes/interfaces inherited from class edu.kzoo.grid.Grid |
---|
edu.kzoo.grid.Grid.BoundedGridValidityChecker, edu.kzoo.grid.Grid.InternalRepresentation, edu.kzoo.grid.Grid.UnboundedGridValidityChecker, edu.kzoo.grid.Grid.ValidityChecker |
Field Summary |
---|
Fields inherited from class edu.kzoo.grid.Grid |
---|
includeDiagonals, internalRep, UNBOUNDED |
Constructor Summary | |
---|---|
BingoCard(int max_value)
Constructs a new BingoCard object containing numbers in the range of 1 -- max_value. |
Method Summary | |
---|---|
BingoValueCell |
getCellAt(int row,
int col)
Returns the cell at the given (row, col) location, or null if there is no Bingo value cell there. |
void |
indicateCardWon()
Indicates this card won by setting the column headings to the highlight color used to mark numbers. |
void |
initialize()
Set up (or reset) the card with column headings and random Bingo values. |
void |
playNumber(int numToPlay)
If this bingo card contains numToPlay, marks it as found. |
Methods inherited from class edu.kzoo.grid.BoundedGrid |
---|
numCols, numRows |
Methods inherited from class edu.kzoo.grid.Grid |
---|
add, allObjects, getDirection, getNeighbor, isEmpty, isValid, neighborsOf, numAdjacentNeighbors, numObjects, objectAt, randomDirection, remove, remove, removeAll, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BingoCard(int max_value)
Method Detail |
---|
public BingoValueCell getCellAt(int row, int col)
null
if there is no Bingo value cell there.
public void indicateCardWon()
public void initialize()
public void playNumber(int numToPlay)
numToPlay
- the number to play (mark if found)