This will be a text based implementation but would be easy to port into a graphic based version.
changePlayer
method.mark
method, that puts the replaces the grid location with the letter stored in player
, and then calls the changePlayer
method (Don't reduplicate code inside the mark
method).getPlayer
methodmovesRemaining
that returns the number of spaces in grid
print
method:
public static void main(String[] args)
Next we can work on the game, and the testing the winner()
method of the TicTacToe2
class.