GreedyMCPlayer - a simple, greedy Monte Carlo implementation of the player interface for PokerSquares.
For each possible play, continues greedy play with random possible card draws to a given depth limit
(or game end). Having sampled trajectories for all possible plays, the GreedyMCPlayer then selects the
play yielding the best average scoring potential in such Monte Carlo simulation.
Disclaimer: This example code is not intended as a model of efficiency. (E.g., patterns from Knuth's Dancing Links
algorithm (DLX) can provide faster legal move list iteration/deletion/restoration.) Rather, this example
code illustrates how a player could be constructed. Note how time is simply managed so as to not run out the play clock.
Author: Todd W. Neller
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.
It is the player's responsibility to record its own moves, which and how many cards have been played, etc.
setScoreSystem - provides the player with the point system that will be used in subsequent games
until a new point system is specified by the same method. Players can assume that (1) this will be
the first method called on a PokerSquaresPlayer, and (2) it will be followed immediately by a call
to init(). The amount of time allotted to the player to prepare for using this system is given by
parameter millis. After the given number of milliseconds, or after the player returns
from this method, the player should be ready to play. It is permissible to perform such computation
on a separate thread, but the player should be able to play immediately after the return from this
method or after the allotted time, whichever comes first.