Question: TASK 3 : Complete the main.c The program will accept one additional command line argument, which is the number of Champions each player will start
TASK : Complete the main.c
The program will accept one additional command line argument, which is the number of
Champions each player will start with. Your program must determine if there is this command
line argument:
o If the command line argument does not exist, print an error, and end the program.
o If the command line argument, check to see if it is a number greater than If it is not,
print an error and end the program.
Build each players Champion linked list based on the size passed in through the command line
argument.
Start the game loop. The game continues so long as both players have Champions to battle with.
In each turn iteration of the loop:
o Print out the round number starting at
o Print out each player's Champions using printChampionList
o Implement the outcomes for each permutation of Champion roles. There are
permutations of MM MF MS MT FM FF FS FT SM SF SS ST TM TF TS TT
Using the table for battle outcomes, decide who wins losses, and implement
the reward punishment on both players. For this, you will need to use the
functions createChampion addChampion and removeChampion
Remember that at the end of each turn, the champions already deployed in the
battle will be removed from the players lists BEFORE implementing the reward
punishment based on the battle outcome.
o Print the outcome for the battle and move to the next round.
At the end of the loop, there will be either a tie ie no player has any champions left or one
player who wins ie still has champions Determine and print this final outcome of the game.
Remember to empty the entire list of champions for the players by freeing the memory for the
linked list, before ending the program.
Task : Create a makefile
Create a makefile to compile and link all the files together. The grader will compile your code using
your makefile. The name of the executable must be projectExe
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
