public class BitField extends AbstractField
height, turnCounter, width| Constructor and Description |
|---|
BitField(int w,
int h)
width * (height+1) must be smaller than or equal to 64
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkWin(int player)
Check if player (0 or 1) has won
|
double |
evaluatePlayerZero()
Count the number of possible 4-in a row one can build using
existing coins plus empty spaces.
|
long |
getConfig()
Get the configuration of the Board in a long
Returns the symmetric configuration if its number is smaller
|
int |
getField(int x,
int y)
What is on field x,y?
|
boolean |
isOpen(int column)
Checks if there can a coin be dropped into
|
void |
makeMove(int column)
Makes a move (also for the symmetric situation)
|
void |
undoMove()
Undoes a move (also for the symmetric situation)
|
checkDraw, getPlayer, getTurnCounter, toStringpublic BitField(int w,
int h)
w - h - public long getConfig()
public void makeMove(int column)
makeMove in class AbstractFieldcolumn - public void undoMove()
undoMove in class AbstractFieldpublic boolean checkWin(int player)
AbstractFieldcheckWin in class AbstractFieldpublic double evaluatePlayerZero()
evaluatePlayerZero in class AbstractFieldpublic int getField(int x,
int y)
AbstractFieldgetField in class AbstractFieldpublic boolean isOpen(int column)
AbstractFieldisOpen in class AbstractField