Class RandomPokerSquaresPlayer
java.lang.Object
RandomPokerSquaresPlayer
- All Implemented Interfaces:
- PokerSquaresPlayer
public class RandomPokerSquaresPlayer
- extends java.lang.Object
- implements PokerSquaresPlayer
RandomPokerSquaresPlayer - a simple example implementation of the player interface for PokerSquares that makes random placements.
Author: Todd W. Neller
Field Summary |
java.util.Stack<java.lang.Integer> |
plays
|
Method Summary |
int[] |
getPlay(Card card,
long millisRemaining)
getPlay - gets the current play position for a given card within the allotted number of milliseconds. |
void |
init()
init - initializes the player before each game |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
plays
public java.util.Stack<java.lang.Integer> plays
RandomPokerSquaresPlayer
public RandomPokerSquaresPlayer()
init
public void init()
- Description copied from interface:
PokerSquaresPlayer
- init - initializes the player before each game
- Specified by:
init
in interface PokerSquaresPlayer
getPlay
public int[] getPlay(Card card,
long millisRemaining)
- Description copied from interface:
PokerSquaresPlayer
- getPlay - gets the current play position for a given card within the allotted number of milliseconds.
Each card passed to getPlay has been drawn from the game deck.
Each legal returned move will be made for the player.
Thus, this method contains all information necessary to maintain current game state for the player.
- Specified by:
getPlay
in interface PokerSquaresPlayer
- Parameters:
card
- - card just drawn.millisRemaining
- - remaining milliseconds for play in the rest of the player's game.
- Returns:
- a 2D int array with the chosen (row, col) position for play of the given card.
main
public static void main(java.lang.String[] args)