1,277
edits
Changes
→Gameboard & chips ADT: -bb – updating, cleanup, formatting
Members: Paul, -bb; Andrew, -fe; Jordan, -er <!-- borokhov, vo, berk -->
===Gameboard & chips ADT===
/* Paul can do this - it's a essentially a copy from the Oceans project, so it's quick */ // Gameboard abstract data type– Gameboard class // board field stores a board using an array of Chips (not that important – '''fields''': public static final int SDEPTH = 10, given to no one has access to this field anyway)-depth constructor // '''methods are required to retrieve/store chips Gameboard class fields: private Chip[] board methods''':
// inserts a chip of the given color in the specified place as determined by an x, y coord pair
// returns true if the insertion succeeds; false otherwise
Chip retrieveChip(int x, int y)
// returns true if the given move is valid; false otherwise
/* Verified conditions:
# No chip may be placed in any of the four corners.
# No chip may be placed in a goal of the opposite color.
# No chip may be placed in a square that is already occupied.
# A player may not have more than two chips in a connected group, whether connected orthogonally or diagonally. */
boolean validMove(Move m)
// Chip abstract data type to hold information about chips– Chip class
// color field stores the chip's color as a static final int; x and y fields store the chip's x and y coords, respectively
// returns the chip's color
int getColor()