tictactoe2
This is an old revision of the document!
Tic-Tac-Toe: 2D array
This will be a text based implementation but would be easy to port into a graphic based version.
- Complete the constructor so the board can be any size, not just 3 by 3. Read the comments for details
- complete the
changePlayermethod. - complete the
markmethod, that puts the replaces the grid location with the letter stored inplayer, and then calls thechangePlayermethod (Don't reduplicate code inside themarkmethod). - complete the
getPlayermethod - -make a method called
movesRemainingthat returns the number of spaces ingrid - write a main method that makes an instance of the TicTacToe2 class and the calls the
printmethod:
public static void main(String[] args)
Next we can make the game.
- make a class called
TicTacToeTextGamewith the first line: a main method.
tictactoe2.1604158000.txt.gz · Last modified: 2020/10/31 11:26 by frchris