User Tools

Site Tools


bingo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
bingo [2021/05/01 10:48] frchrisbingo [2021/05/01 12:41] frchris
Line 5: Line 5:
 It's not just a song from summer camp, its an old-timey game: Here is a [[https://www.youtube.com/watch?v=nGCEpUAnkSg|Video Explaining the rules]] It's not just a song from summer camp, its an old-timey game: Here is a [[https://www.youtube.com/watch?v=nGCEpUAnkSg|Video Explaining the rules]]
  
-First we will make a BingoCard class and later we will make a BingoGame class.+First we will make a ''BingoCell'' class, then a ''BingoCard'' classand finally we will make a ''BingoGame'' class.
  
-The BingoCard class will need:+The ''BingoCell'' class would be a subclass of {{ ::cell.java |Cell}}  that would add the attributes of a number and a font. It will have its own draw method that can draw its number.  Here is a hint on how to build upon the draw method of the parent class: {{::drawhint.png?200|}} For now, let a cell that is "off" represent an uncalled number, and a "on" cell be one that the player has clicked on when that number is called. Later you may wish represent a called number differently. The class should have the following: 
 +  - Constructors that can will allow a client class to initialize the digit (the number 0 can be used as the center "free" cell 
 +  - accessor methods so a client class can know a cell's number 
 +  
 +You can test out your BingoCell class by adapting {{ ::celltester.java |CellTester.java}} to construct new ''BingoCell''s in the resetCell method.  The rest would nopt need to be changed since ''BingoCell'' is a ''Cell'' 
 + 
 + 
 + 
 +The ''BingoCard'' class will need:
   - a 2-D array of BingoCells   - a 2-D array of BingoCells
   - a method that constructs the card so that:   - a method that constructs the card so that:
Line 15: Line 23:
       - The "G" column has 5 unique numbers from 46-60       - The "G" column has 5 unique numbers from 46-60
       - The "O" column has 5 unique numbers from 61-75       - The "O" column has 5 unique numbers from 61-75
 +  - a toString method that has no parameters, and returns a string representation of the board that is similar to : {{::bingotext.png?200|}}
 +  - 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.txt · Last modified: 2021/05/10 12:08 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki