|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.anji.ttt.TttCenterPlayer
public class TttCenterPlayer
"Bad" tic-tac-toe subject with a preference for playing in the center. See
move() for details.
| Constructor Summary | |
|---|---|
TttCenterPlayer()
singleton; public for creation via reflection |
|
| Method Summary | |
|---|---|
static TttCenterPlayer |
getInstance()
|
java.lang.String |
getPlayerId()
|
int |
move(int[] boardState)
Plays in center if open, otherwise plays randomly. |
void |
reset()
reset player state; after a call to reset, the player should be in the same state as it was when created; i.e., it has no memory of previous games played |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TttCenterPlayer()
| Method Detail |
|---|
public static TttCenterPlayer getInstance()
public java.lang.String getPlayerId()
getPlayerId in interface PlayerPlayer.getPlayerId()public int move(int[] boardState)
move in interface BoardPlayerBoardPlayer.move(int[])public void reset()
Player
reset in interface PlayerPlayer.reset()public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||