Elinor78 / Bingo

Advanced Java Bingo Project
0 stars 0 forks source link

Class needed: non-GUI ComputerCard #49

Closed gregknight closed 10 years ago

gregknight commented 10 years ago

It's a 3 dimensional array: a grid of integers with a "z" dimension of boolean type, indicating whether the space is marked or not. It needs a constructor that places the appropriate random integers in the grid. It needs a method for setting the boolean value of a particular grid space. It needs pattern validation.

There are no visual elements, therefore do NOT include it as part of the Card hierarchy. The point of ComputerCard is reduce overhead.

See my algorithm in PlayerCard's constructor for generating the correct random numbers. It's all done for you; the only difference is that this is an array of integers rather than Cell objects. Also see Sidney's algorithm for checking for a valid bingo pattern.

gregknight commented 10 years ago

Another note on ComputerCard: Just like PlayerCard, if a successful bingo is achieved, that card should be removed from play. Maybe ComputerCard has an instance variable called isBingo that's checked before any attempt to search for a number to be marked; if isBingo is true, we can skip the entire operation.

jtrwallace commented 10 years ago

Closed #49