Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C language) Can I please get help on this program? It's a followup to two programs I already have. Please ensure it compiles without errors

(C language) Can I please get help on this program? It's a followup to two programs I already have. Please ensure it compiles without errors using the gcc compiler, thank you, I really need help on this one. I will include the programs I already have for the rest of the questions.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

==================================================================================================================================

Here are the earlier programs I have:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Program 3 Write a third program that takes an integer command-line argument representing the move number and loops over all possible boards. When it finds a board that matches the move number, the program should determine if someone is the winner (according to the winner function you wrote earlier). If the game is a win, loss or tie ('2, '1, or 'O'), it should set the "winner" value in the strategy_struct variable to that value, set the "best move" value to -1, and save the structure in the appropriate position in the binary file. If the game is undetermined (the winner function returns "(blank space), then your program should look at all the possible moves that can be made and look at the winner value stored in the file for each of the resulting boards. It should then do the following: If there is a move that leads to a board whose "winner" value matches the current player's "turn" (i.e. the current player can make a winning move), then set the winner value in the strategy_struct variable to the current player and set the "best_move" to whatever move led to that board. If there is no winning move, but there is a tying move, then set the winner value in the strategy_struct to 'o' (tie) and set the "best move" to whatever move led to that board. If there are no winning moves, and no tying moves, then set the winner value to the opponent's character and set the "best_move" to the last (highest numbered) legal move. . Run your program with the command line argument set to 9, 8,7,6,5,4,3, 2, 1,0. At this point your program will have mastered the game of tic-tac-toe and incorporated its body of knowledge in the "strategyfile

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sybase Database Administrators Handbook

Authors: Brian Hitchcock

1st Edition

0133574776, 978-0133574777

Students also viewed these Databases questions

Question

4-6 Is there a digital divide? If so, why does it matter?

Answered: 1 week ago