Changes

Jump to: navigation, search

Computer Science/61b

426 bytes added, 03:33, 18 October 2006
updating
==Project 2 modules==
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
// returns true if the move succeeds; false otherwise
boolean moveChip(Chip c, int x, int y)
// performs a move and returns true/false depending on whether it succeeded
boolean performMove(int color, Move m)
// returns the Chip at a given location as determined by an x, y coord pair
Chip retrieveChip(int x, int y)
Chip class
fields (all private): int color, int x, int y
public static final WHITE/BLACK = 1/-10
methods:
// returns the chip's color
int getY(Chip c)
-------==Changes to MachinePlayer class=====New fields=== int colorint depthGameboard board In MachinePlayer class - methods:===Methods===
/* Andrew? */
// generates an array of Gameboards of all the possible moves from the current Gameboard g for a given player. returns an array of Gameboards
Gameboard[] generateMoves(Gameboard g, int color)
----
/* Paul? */
// evaluates an array of gameboards using the minimax algorithm and alpha-beta pruning.
// if necessary, generates additional move levels (i.e. if none of the gameboards in this array result in a win)
Move evalTree(Gameboard[] arr)
----
/* Jordan? */
// evaluates the given network for a winning color
// returns the winning color (as Chip.color), 0 -10 if there is no winner // '''NOTE''': we need to figure out how to rate a board that doesn't win and we're already at the lowest level – some sort of probability technique, how many connections there are with the current chips, etc....
int winner(Gameboard g)
1,277
edits

Navigation menu