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:51] frchrisbingo [2021/05/02 10:57] 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 ===+=== BingoCell ===
  
 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. 
Line 27: Line 27:
   - 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   - 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)   - 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.+  - 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.   You can test out your BingoCell class by adapting {{ ::celltester.java |CellTester.java}} to construct new ''BingoCell''s in the ''resetCells()'' method.  
Line 33: Line 35:
 {{::screen_shot_2021-05-02_at_7.26.45_am.png?600|hint}} {{::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)  When you are done, the ''CellTester'' application should look like something like this: 
 + 
 +{{::screen_shot_2021-05-02_at_7.55.50_am.png?600|}}
  
  
bingo.txt · Last modified: 2021/05/10 12:08 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki