User Tools

Site Tools


tictactoe2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tictactoe2 [2020/10/31 11:11] frchristictactoe2 [2020/11/03 15:03] (current) frchris
Line 1: Line 1:
 ====== Tic-Tac-Toe: 2D array ====== ====== Tic-Tac-Toe: 2D array ======
 This will be a text based implementation but would be easy to port into a graphic based version. This will be a text based implementation but would be easy to port into a graphic based version.
 +
 +{{ :tictactoe2.java |TicTacToe2.java}}
  
   - Complete the constructor so the board can be any size, not just 3 by 3. Read the comments for details   - Complete the constructor so the board can be any size, not just 3 by 3. Read the comments for details
   - complete the ''changePlayer'' method.   - complete the ''changePlayer'' method.
   - 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).   - 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).
 +  - complete the ''getPlayer'' method
 +  - make a method called ''movesRemaining'' that returns the number of spaces in ''grid''
   - write a main method that makes an instance of the TicTacToe2 class and the calls the ''print'' method:   - write a main method that makes an instance of the TicTacToe2 class and the calls the ''print'' method:
 ''public static void main(String[] args)'' ''public static void main(String[] args)''
  
-Next we can make the game.  +Next we can work on the game, and the testing the ''winner()'' method of the ''TicTacToe2'' class.  
-  - make a class called ''TicTacToeTextGame'' with a main method.  + 
 +{{ :tictactoetextgame.java |TicTacToeTexGame.java}} 
 + 
 +{{ ::winnertester.java |WinnerTester.java}}
  
tictactoe2.1604157084.txt.gz · Last modified: 2020/10/31 11:11 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki