Question: Problem 4. Tic-Tac-Toe, Part 4 (20 points) Save a copy of your program and modify it to include a struct for player with fields for

 Problem 4. Tic-Tac-Toe, Part 4 (20 points) Save a copy of

Problem 4. Tic-Tac-Toe, Part 4 (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 chess ('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. The single-player mode should create a struct for the computer player that assigns it the name "computer" and the letter X. Use the following definition and function prototypes: typedef struct Player\ char name[30]; char chess; l player; void makeMove(char board[0l3], player p) int checkWinner(char board[1[3], player po, player px) void makeComputerMove(char board[1[3], player px) Tips: Claim a player variable, and initialize values: player po; pochess 'O'; printf("Enter a name for player O: "); scani("%s", po.name); Assign a string to a char array: player px; sprintf(px.name, "Computer"); *

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!