Provide a text-based interface for playing the game of Ataxx making use of the
AtaxxState class.
Initially, print four lines as follows:
ATAXX
A position is indicated by a letter and number as in Chess (e.g. "b4").
For a growth move, please enter the position into which you will grow.
For a jump move, please enter the from and to positions separated by a space.
Enter "undo" to undo a move.
Then, for each turn of the game, print the board using
stateToString to generate the board
String.
Print a blank line, prompt the user for a move with "Move? ", and read the user input.
If the user input is "undo", either revert to the previous game state or, if there is none, print "Cannot undo."
If the move has an illegal input format, print the message "Illegal move format.".
If the move has a legal input format but is an illegal move, print "Illegal move.".
Otherwise, the move is taken. (Note: The return value of
AtaxxState class
makeMove method provides illegal move feedback.)
Once the game ends, the board is printed one last time.