|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PokerSquares
public class PokerSquares
Field Summary | |
---|---|
static long |
GAME_MILLIS
|
static int |
SIZE
|
Constructor Summary | |
---|---|
PokerSquares(PokerSquaresPlayer player,
long gameMillis)
|
Method Summary | |
---|---|
static int |
getHandScore(Card[] hand)
Get the score of the given Card hand. |
static int[] |
getHandScores(Card[][] grid)
Get an int array with the individual hand scores of rows 0 through 4 followed by columns 0 through 4. |
static int |
getScore(Card[][] grid)
Get the score of the given Card grid. |
static void |
main(java.lang.String[] args)
Demonstrate testing of a PokerSquaresPlayer. |
int |
play()
Play a game of Poker Squares with the given PokerSquaresPlayer and time limit, returning the game score. |
int[] |
playSequence(int numGames,
long startSeed,
boolean verbose)
Play a sequence of games, collecting and reporting statistics. |
static void |
printGrid(Card[][] grid)
Print the current game grid and score. |
static void |
scoreTest()
Test the correctness of scoring code. |
void |
setSeed(long seed)
Set the seed of the game pseudorandom number generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SIZE
public static final long GAME_MILLIS
Constructor Detail |
---|
public PokerSquares(PokerSquaresPlayer player, long gameMillis)
player
- Poker Squares player objectgameMillis
- maximum milliseconds permitted for gameMethod Detail |
---|
public int play()
public int[] playSequence(int numGames, long startSeed, boolean verbose)
numGames
- number of games to playstartSeed
- seed of first game. Successive games use successive seedsverbose
- whether or not to provide verbose output of game play
public static void printGrid(Card[][] grid)
grid
- current game gridpublic static int getScore(Card[][] grid)
grid
- Card grid
public static int[] getHandScores(Card[][] grid)
grid
- 2D Card array representing play grid
public static int getHandScore(Card[] hand)
hand
- Card hand
public void setSeed(long seed)
seed
- pseudorandom number generator seedpublic static void scoreTest()
public static void main(java.lang.String[] args)
args
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |