Question: Summary - Write a C program that allows two people to play a game of Tic-Tac-Toe. The rules are as follows: *The game is played

Summary - Write a C program that allows two people to play a game of Tic-Tac-Toe. The rules are as follows: *The game is played on a 3x3 grid *There are two players, each player is assigned either an X or O token *Players take turns placing their tokens into empty squares *The first player to get 3 tokens in a row (horizontally, vertically, or diagonally) is the winner *If no player gets 3 tokens in a row, the match is a draw Required functionality: 1. All the rules listed above must be implemented. 2. If a player selects a square which is already occupied, the program should inform them the space is filled and require that they indicate a new space. 3. As soon as a player gets 3 tokens in a row, they should be declared the winner and the game should end. In other words, dont wait until all nine moves have been made to determine the winner. 4. The program should operate in a loop, asking the users if they would like to play again after the game is over 5. Any accesses to arrays should be done with pointers and pointer arithmetic ONLY. a. There should be NO square brackets used when indexing into any arrays b. No counters should be used for looping over arrays. You should loop by using pointer arithmetic. 6. You must modularize your program by breaking it up into functions.

Some example function names are:

a. playGame

b. printBoard

c. checkForWinner

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!