User Tools

Site Tools


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.

  1. Complete the constructor so the board can be any size, not just 3 by 3. Read the comments for details
  2. complete the changePlayer method.
  3. complete the 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).
  4. write a main method that makes an instance of the TicTacToe2 class and the calls the print method.

Next we can make the game.

  1. make a class called TicTacToeTextGame with a main method.
tictactoe2.1604157034.txt.gz · Last modified: 2020/10/31 11:10 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki