Simulate the classic card game war using a singly linked list.

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

Learning Goal: I’m working on a c programming project and need an explanation and answer to help me learn.Assignment DetailsFor this programming assignment, you will get to simulate the classic card game war using a singly
linked list. Rules for the game can be found at this website: https://gamerules.com/rules/war-card-game/
In this program we will always assume only two players will play. This means each player will represent
its own linked list (that’s right two separate linked lists). As the rules state there are a total of 52 cards.
The following number list shows each set of cards in the deck. Each type contains 4 (♠, ♣, ♥, and ♦) cards
(hence 4 ∗ 13 = 52 cards total).
1. Ace
2. King
3. Queen
4. Jack
5. 10
6. 9
7. 8
8. 7
9. 6
10. 5
11. 4
12. 3
13. 2
Also, the order presented shows the order of card dominance (top being the highest and bottom being the
lowest). This will determine which player wins after cards are drawn. For example, if Player A draws the
card king of hearts and Player B draws the card 9 of clubs, then Player A wins that round. As a result,
Player A takes its own card drawn and Player B’s card and puts it in the back of the pile (sounds like
inserting the back of a linked list ). Now as the rules state, the objective of the game is to get the
player to lose all their cards (this sounds like until the respective player’s linked list is empty )The Provided Skeleton File
You were provided with a skeleton C file that has the main function and function prototypes. This section
will discuss the lines of code provided for you in the main function to assist you with understanding how
the code will execute.
Lines 6 – 8 shows the preprocessor directives.
Lines 10 – 14 defines the typedef struct called card_t you will be utilizing in the
assignment. The struct contains the following member components.
o An integer called rank. This will keep track of the priority of the card. This is
utilized in determining the winning round when cards are drawn.
o A char pointer called type. This is a dynamic string. It will store the card name.
Examples include “8 of Spades”, “6 of Hearts”, “Ace of Hearts”, etc…
o A struct pointer called nextptr that points to a cart_t struct. This is simply the
node in the linked list.
Line 33-37 sets the seed. At this point in the course you should know what that does. The test
script uses the value 0 as the test seed.
Line 38 is a call to a user-defined function called rules. This function has already been
implemented for you since it is just printf statements .
Lines 40 and 41 are just variable declarations. Variable player represents the player you get to
choose. You can either be player 1 or 2. This is done in lines 43 – 45. Variable result, will
determine which player won in displaying the respective message. You will be playing
against the computer.
Lines 47 – 58 shows a for loop that simulates a game. It will keep track which game number
the simulation is playing. It should only play up to 5 games total.
Line 52 calls the function playRound which simulates an entire game. The function returns
an integer that is stored in result. This value is used to determine to proper message to
display to the terminal window based on the player you pick at the beginning of the
simulation run.
Requirements: a running C program with no error

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services