public class MeTTTaPojo extends java.lang.Object implements IMeTTTaPojo, IMeTTTaConstants
G_COMPUTER, G_HUMAN, G_NULL, GS_CWIN, GS_DRAW, GS_HWIN, GS_MORE, GS_NOTYET, GS_WIN, TURN_COMPUTER, TURN_HUMAN, TURN_NULL
Constructor and Description |
---|
MeTTTaPojo() |
Modifier and Type | Method and Description |
---|---|
int |
getCalculatedMove(java.util.List grid)
Get a calculated move given a collection of already played positions.
|
static int |
getRandomInt(int minVal,
int maxVal)
Get random integer >= minVal and < maxVal.
|
static void |
main(java.lang.String[] args)
main, for testing
|
static void |
setGameVars()
Set game parameters.
|
static int |
test4Win(int[] grid,
int player)
Test for a win.
|
public int getCalculatedMove(java.util.List grid)
IMeTTTaPojo
getCalculatedMove
in interface IMeTTTaPojo
grid
- The positions that have been played or not played up to now.public static int test4Win(int[] grid, int player)
grid
- The positions that have been played or not played up to now.player
- Player: G_HUMAN or G_COMPUTERpublic static void setGameVars()
public static int getRandomInt(int minVal, int maxVal)
minVal
- The result will be >= this value.maxVal
- The result will be < this value.public static void main(java.lang.String[] args)
args
-