Question: In C program Enhance the tic - tac - toe game so 2 people can play. To do this, you need to add an O

In C program Enhance the tic-tac-toe game so 2 people can play. To do this, you need to add anO that, like the X, is drawn in the square. Then prompt the user for a square identifier, and alternate between drawing Xs and Os at those locations on the board. The first move is for X. You need to detect and reject when a user plays a square that is already taken. Stop after the board is full (that is,9 plays). You do not have to worry about who wins.
The O is to be 5\times 5, centered in the middle of the square.
Here are the messages your program should print to the standard output:
The tic-tac-toe board, with Xs and Os as appropriate;
When it is Xs turn, print Xs turn >(note the space after the >); and
When it is Os turn, print Os turn >(again, note the space after the >).
Here are the error messages; all are to be printed on the standard error:
When the user enters only 1 co-ordinate: Need 2 co-ordinates
(the
is a newline);
When there is an illegal character in the input: Illegal character in input "%c"
(the %c is to print the offending character); and
When the square is already occupied: %c has played %d,%d
(where %c is either X or O, whichever is already in the square, and %d,%d are the co-ordinates of the occupied square); and
When an invalid set of co-ordinates are entered: %d,%d is not a valid square; the numbers must be between 1 and 3 inclusive
(each %d is one of the invalid numbers).
If the program reads an end of file at the prompt, print a newline and quit.
The program should exit with an exit status code of 0.occupied square)
In problem 1, the dimensions of the "O" was added; it is to be 55 centered in the square.
For all problems, the exit status code is 0.
(25 points) Enhance the tic-tac-toe game so 2 people can play. To do this, you need to add an "O" that, like the "x", is drawn in the square. Then prompt the user for a square identifier, and alternate between drawing
"X"s and "O"s at those locations on the board. The first move is for "x". You need to detect and reject when a user plays a square that is already taken. Stop after the board is full (that is,9 plays). You do not have to
worry about who wins.
The "O" is to be 55, centered in the middle of the square.
Here are the messages your program should print to the standard output:
The tic-tac-toe board, with "x"s and "O"s as appropriate;
When it is "x"'s turn, print "x's turn >"(note the space after the ">"); and
When it is "O"'s turn, print "0's turn >"(again, note the space after the ">").
Here are the error messages; all are to be printed on the standard error:
When the user enters only 1 co-ordinate: "Need 2 co-ordinates ??
"(the '' is a newline);
When there is an illegal character in the input: "Illegal character in input "8c"n"(the "%" is to print the offending character); and
When the square is already occupied: "% has played %d,%d?
"(where "%c" is either "x" or "O", whichever is already in the square, and "%d,%d" are the co-ordinates of the occupied square); and
When an invalid set of co-ordinates are entered: "%d,%d" is not a valid square; the numbers must be between 1 and 3 inclusiveln" (each %d is one of the invalid numbers).
If the program reads an end of file at the prompt, print a newline and quit.
The program should exit with an exit status code of 0.
Please call your program ttt4 a.c and submit it through Gradescope. A sample executable, used to generate the Gradescope validation outputs, is available on the CSIF at /home/bishop/hw4/ttt4a. In C program
 In C program Enhance the tic-tac-toe game so 2 people can

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!