Create the game of Tic Tac Toe. This will be a two player game. The grid is initialized with the letters A to I, and the user then enters the letter to choose their move. The program should report if...


Create the game of Tic Tac Toe. This will be a two player game.


The grid is initialized with the letters A to I, and the user then enters the letter to choose their move. The program should report if they have won.


Create a TicTacToe class with the following items:



Class Variables:



  • 2D String Array initialized with the letters A to I.

  • String variable for the current player initialized to X



Methods

void switchPlayer(); //If the current player is an X, make the current player an O otherwise make the current player an X.void move(String move); //Allows the current player move: Parameter move represents thebool hasWon(); //Returns true if the current player has wonString toString(); //Returns a string version of the grid for display
Apr 10, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here