Use a two dimensional array to represent the game board use


Your game must:

  1. Use a two dimensional array to represent the game board
  2. Use a while loop and conditional logic to allow two players to take turns.
  3. Allow the user to specify where they would like to move.
  4. When the user enters the position of their move, you should display an updated game board showing their move (or throw an exception if they try to move to a location that isn't empty).
  5. Display "Humans player wins", "Computer wins", or "It's a draw." when the game is over.
  6. Maintain a record of each game in a file called games.txt. The results of each game should beappendedto the file.  It should be displayed to the user before every new game, and be displayed in the format below:

Game 1: Human player wins

Game 2: Computer wins

Game 3: Computer wins

Note: You don't need to make the computer player behave intelligently.  It's fine for the computer to choose any available position randomly.

Solution Preview :

Prepared by a verified Expert
Business Management: Use a two dimensional array to represent the game board use
Reference No:- TGS01714480

Now Priced at $30 (50% Discount)

Recommended (98%)

Rated (4.3/5)