Question: Here is the code that needs to be modified for thee question. The programming language is C NOT C++. 3. Tic-Tac-Toe, Part 3 (20 Points)

Here is the code that needs to be modified for thee question. The programming language is C NOT C++.

Here is the code that needs to be modified for thee question.

3. Tic-Tac-Toe, Part 3 (20 Points) Save a copy of your program and modify it to include a struct for player with fields for the name (up to 30 characters) and letter X' or 'o'). Modify your makeMove() function to take a player struct as an argument. Before the game, ask for the names of each player. Display their name when asking them to enter a move. When a player wins, display a message with that player's name. Otherwise, display a message saying that the game was a draw. Use the following function prototype: void makeMove (char [JCCOLS], struct player) Tip: To read in a string of up to 30 characters, use the following line: fgets (name, 30 stdin Doing this will cause the string to end with an An' character. The following line will remove it (you need to include string.h to use the strlen() function). p2.name [strlen (p2.name) 1 0; Example: Enter a name for player X John Smith Enter a name for player O William Wallace 1 2 3 2 3 John Smith enter a move 2 2 1 2 3 2 [X] 3 William Wallace enter a move: 1 2 1 2 3 2 [X] 3

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!