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/02 10:27] frchrisbingo [2021/05/02 10:54] frchris
Line 10: Line 10:
 First we will make a ''BingoBallHopper'' class that will make all 75 bingo balls, and randomly selecting them one at a time, kepping track of which ones were called.  To save time here is the {{ ::bingoball.java |BingoBall.java}} class, the {{ ::bingohoppertester.java |BingoHopperTester}}, and the starter code {{ ::bingohopper.java |BingoHopper.java}}.  You just have to finish the constructor, the ''nextBall()'' method and ''called() method'' Read the comments above each for the details. First we will make a ''BingoBallHopper'' class that will make all 75 bingo balls, and randomly selecting them one at a time, kepping track of which ones were called.  To save time here is the {{ ::bingoball.java |BingoBall.java}} class, the {{ ::bingohoppertester.java |BingoHopperTester}}, and the starter code {{ ::bingohopper.java |BingoHopper.java}}.  You just have to finish the constructor, the ''nextBall()'' method and ''called() method'' Read the comments above each for the details.
  
-{{::hoppertesterpic.png?400|}}+{{::hoppertesterpic.png?600|}}
  
 === BingoCard/BingoCell === === BingoCard/BingoCell ===
Line 16: Line 16:
 Next we turn to the player's Bingo cards.  We will make a clickable box for each square that we'll call the ''BingoCell'' class, then make a 5x5 grid of these which we will call the ''BingoCard'' class.  Next we turn to the player's Bingo cards.  We will make a clickable box for each square that we'll call the ''BingoCell'' class, then make a 5x5 grid of these which we will call the ''BingoCard'' class. 
  
-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: +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 do one of the Constructors: 
-  - 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+{{::screen_shot_2021-05-02_at_7.30.48_am.png?600|}} 
 + 
 +Here is a hint on how to build upon the draw method of the parent class:  
 + 
 +{{::screen_shot_2021-05-02_at_7.32.37_am.png?600|}} 
 + 
 +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: 
 +  - The Cell class 3 Constructors to allow a client class more access and flexibility.  Add at least one more constructor to the ''BingCell'' class that uses one of the other ''Cell'' class's constructors. Remember to have a parameter to initialize the BingoCell's number 
 +  - accessor methods so a client class can know a cell's number (getNumber, getFont, setNumber, setFont) 
 +  - Change the ''draw'' method so that if the number is 0, it will draw "free" instead. Here is a hint: 
 + 
 +{{::screen_shot_2021-05-02_at_7.53.48_am.png?600|}}
    
-You can test out your BingoCell class by adapting {{ ::celltester.java |CellTester.java}} to construct new ''BingoCell''s in the ''resetCells()'' method.  {{::screen_shot_2021-05-02_at_7.26.45_am.png?400|}}+You can test out your BingoCell class by adapting {{ ::celltester.java |CellTester.java}} to construct new ''BingoCell''s in the ''resetCells()'' method.   
 + 
 +{{::screen_shot_2021-05-02_at_7.26.45_am.png?600|hint}}
  
 The rest would not need to be changed since a ''BingoCell'' is a ''Cell'' Eventually, your ''BingoBoard'' class would be the ultimate test of your ''BingoCell'' class! The rest would not need to be changed since a ''BingoCell'' is a ''Cell'' Eventually, your ''BingoBoard'' class would be the ultimate test of your ''BingoCell'' class!
bingo.txt · Last modified: 2021/05/10 12:08 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki