public class MinMaxPlayer extends ReversiPlayer
Modifier and Type | Field and Description |
---|---|
(package private) int[][] |
arrayOfMoves |
private int |
height
Height of the playground
|
private int |
myColor |
(package private) int[][] |
myPriceArray |
(package private) int |
myPriceGlob |
private int |
opponentColor |
(package private) int[][] |
oppPriceArray |
(package private) int |
oppPriceGlob |
private int |
priceCorner |
private int |
priceEdge |
private int |
priceInside |
private int |
width
Width of the playground
|
Constructor and Description |
---|
MinMaxPlayer() |
Modifier and Type | Method and Description |
---|---|
private void |
evaluateTheBoard(int[][] playground) |
private void |
generateNextMoves(int[][] playground) |
java.lang.String |
getName()
Returns name of the reversi player.
|
private boolean |
isInTheCorner(int i,
int j) |
private boolean |
isOnBoard(int i,
int j) |
private boolean |
isOnTheEdge(int i,
int j) |
ReversiMove |
makeNextMove(int[][] playground)
makeNextTurn is called by the reversi server when the player has to compute the next move.
|
private void |
tryMove(int i,
int j,
int[][] playground,
int stepI,
int stepJ) |
endGame, getEmptySquareColor, getMyColor, getOpponentColor, init, toString
private int priceCorner
private int priceEdge
private int priceInside
private int width
private int height
private int myColor
private int opponentColor
int[][] arrayOfMoves
int[][] myPriceArray
int[][] oppPriceArray
int oppPriceGlob
int myPriceGlob
public java.lang.String getName()
ReversiPlayer
getName
in interface ReversiPlayerInterface
getName
in class ReversiPlayer
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.private void generateNextMoves(int[][] playground)
private void evaluateTheBoard(int[][] playground)
private void tryMove(int i, int j, int[][] playground, int stepI, int stepJ)
private boolean isOnBoard(int i, int j)
private boolean isOnTheEdge(int i, int j)
private boolean isInTheCorner(int i, int j)