Question: Driver should not be changed /** * Write a description of class Driver here. * * @author (your name) * @version (a version number or

 Driver should not be changed /** * Write a description of

class Driver here. * * @author (your name) * @version (a version

Driver should not be changed

/** * Write a description of class Driver here. * * @author (your name) * @version (a version number or a date) */ public class Driver { public static void main(String[] args) { TicTacToe game = new TicTacToe(3); game.play(); game.play(); game.play(); game.play(); } } 

Output

 | | ----------- X | | ----------- | | What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 0 O | | ----------- X | | ----------- | | X What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 1 O | O | ----------- X | | ----------- X | | X What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 2 O | O | O ----------- X | | ----------- X | | X Player won! | | ----------- | | ----------- X | | What row would you like to place a mark in? > 2 What column would you like to place a mark in? > 1 | | ----------- | | ----------- X | O | X What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 1 | | X ----------- | O | ----------- X | O | X What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 0 X | | X ----------- O | O | ----------- X | O | X What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 1 X | O | X ----------- O | O | ----------- X | O | X Player won! | | ----------- | | ----------- | X | What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 1 | O | X ----------- | | ----------- | X | What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 2 | O | X ----------- | X | O ----------- | X | What row would you like to place a mark in? > 2 What column would you like to place a mark in? > 2 | O | X ----------- X | X | O ----------- | X | O What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 0 O | O | X ----------- X | X | O ----------- X | X | O Computer won! | | X ----------- | | ----------- | | What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 0 O | | X ----------- | | ----------- | | X What row would you like to place a mark in? > 0 What column would you like to place a mark in? > 2 What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 4 What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 2 O | | X ----------- | | O ----------- | X | X What row would you like to place a mark in? > 2 What column would you like to place a mark in? > 0 O | | X ----------- X | | O ----------- O | X | X What row would you like to place a mark in? > 1 What column would you like to place a mark in? > 1 O | X | X ----------- X | O | O ----------- O | X | X Tie! 

Problem Statement You will build an application that allows a person to play tic-tac-toe against the computer. Your application will print out the board, the computer select a spot, and ask the user to select spot. This will continue until the game ends (a full row, column, or corner to corner diagonal have the same mark, or if no more moves are possible due to the lack of vacant spots). Your application will do limited error checking to ensure occupied spots won't be overwritten with new values. Finally, the board does not need to be 3x3. Your solution needs to be able to handle any Square (NxN) board. The parameter for board size is passed in the constructor Assignment Create an Outlab6 project and paste this into a Driver. You won't need to change the Driver Here are some specifications and assumptions for you: No player is allowed to mark an already marked spot. If the human tries to do that, an error message must be printed and the player is to be prompted for another spot until they enter a valid one (however many times it takes) o No player is allowed to attempt to mark a spot outside of the bounds of the board (e.g. row 0, column 7 is not allowed in a3x3 board) o The computer move method will randomly select a spot for the computer to place its mark. The spot to be marked must not already be occupied (if it is, just randomly select a new spot. Here is some sample output that needs to be fairly closely replicated (see grading)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!