public class MinimaxPlayer extends ReversiPlayer
Modifier and Type | Field and Description |
---|---|
private static int[] |
dx |
private static int[] |
dy |
private static int |
PLY |
height, myColor, opponentColor, width
Constructor and Description |
---|
MinimaxPlayer() |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkDirection(int dx,
int dy,
int x,
int y,
int[][] playground,
int color) |
private int |
evalBoard(int[][] playground) |
private boolean |
gameOver(int[][] playground) |
private java.util.LinkedHashSet<ReversiMove> |
generateMoves(int[][] playground,
int color) |
java.lang.String |
getName()
Returns name of the reversi player.
|
private int[][] |
makeMove(int x,
int y,
int[][] playground,
int color) |
ReversiMove |
makeNextMove(int[][] playground)
makeNextTurn is called by the reversi server when the player has to compute the next move.
|
private int |
minimaxValue(int[][] playground,
int color,
int ply) |
private boolean |
possibleMove(int x,
int y,
int[][] playground,
int color) |
endGame, getEmptySquareColor, getMyColor, getOpponentColor, init, toString
private static final int[] dx
private static final int[] dy
private static final int PLY
public java.lang.String getName()
ReversiPlayer
getName
in interface ReversiPlayerInterface
getName
in class ReversiPlayer
private boolean checkDirection(int dx, int dy, int x, int y, int[][] playground, int color)
private boolean possibleMove(int x, int y, int[][] playground, int color)
private java.util.LinkedHashSet<ReversiMove> generateMoves(int[][] playground, int color)
private boolean gameOver(int[][] playground)
private int[][] makeMove(int x, int y, int[][] playground, int color)
private int evalBoard(int[][] playground)
private int minimaxValue(int[][] playground, int color, int ply)
public ReversiMove makeNextMove(int[][] playground)
ReversiPlayer
ReversiMove
class encapsulating the coordinates of the stone to be put on the board.makeNextMove
in interface ReversiPlayerInterface
makeNextMove
in class ReversiPlayer
playground
- - contains actual map of the board represented by two-dimensional matrix.
Each sqaure contains number of -1 representing empty square and number 0 and 1 representing players' stones.