Implement the strategy for the "good" player by writing the
function "goodmove();". For this, the following information
on the implementation should be taken into account:
The variable "fields" contains the current board of the
game:
fields[0] fields[1] fields[2]
fields[3] fields[4] fields[5]
fields[6] fields[7] fields[8]
The values are "-", "X" and "O" as displayed on the screen.
The variable movenumber tells how many moves have already been made.
The local variables player and counterplayer inform on the
names ("X" and "O") of the player and his opponent.
The other implemented strategies can be used as an example
of how can it be done. In particular one can also work with
copies of the board as the variable fcopy in the function
mediummove().
wincheck(fcopy) determines which player is winning the
game as it is on the board in the variable fcopy. The
return values are:
"X": player "X" wins
"O": player "O" wins
"D": draw
" ": game not yet terminated, a further move has to be done
The suggest move button for the good player can be used to test
the implemented button before doing whole games or tournaments.