Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need Help!! Please write in C Code Background Information: There is a popular ch

ID: 3815270 • Letter: N

Question

Need Help!!

Please write in C Code

Background Information: There is a popular children's card game known as Old Maid. The game is for two or more players. You can buy a special deck to play this game but you can also use a standard deck of 52 playing cards with a Joker card added to make it a deck of 53 cards. he dealer deals one card at a time to each player proceeding clockwise until all the cards are dealt Usually some players will have more cards than others. The cards of one player are called a player's hand. The players then look at their cards and "discard" all their pairs (cards with the same face value (1-10) or cards with the same Face (Jacks, Queens, and Kings) Examples of pairs would be The 9 of diamonds and the 9 of spades (4) The Jack of clubs (4) and the Jack of hearts The Ace (1) of clubs (4) and the Ace (1) of spades (4) After a matching pairs are discarded, the dealer begins by allowing the player on his/her left to choose one of his/her cards. The player selecting the card cannot see the card since he/she is

Explanation / Answer

You must use the following structure definition for your card:

1>>we can utilize taking after structure definition for your cards

typedef struct card_s

{

int suit[10];

int confront;

struct card_s*listp

} Card;

2>>We ca utilize card clusters to mimic each of the players hands and the deck.

3>>We can Create a full deck of 52 cards with perticular arrange i.e, for each of the four suits,

the cards ought to be all together from Ace (1) through King (13).

4>>Once The Deck is made, we can expel one of the rulers from it, leaving 51 cards.

5>>We must seed the arbitrary number generator with a call to time()function.

6>>We can now rearrange the deck, utilizing the accompanying calculation:

<a> For each card in the deck, get an arbitrary number in the scope of 0 to 50 that to be utilized as the file of the component to swap that card with,

i.e. deck[0] holds the Ace of clubs.

<b> The arbitrary number drawn will be 16, and deck[16] holds the 4 of jewels.

<c> Then after the primary swap, deck[0] would hold the 4 of jewels and deck[16] would hold the Ace of clubs.

<d> Then continue to deck[1], locate an irregular file of a card to swap it with and swap those cards.

7>>After rearranging the deck we should give one card to the client, trailed by one card to the PC and to the client each,

until the sum total of what cards have been utilized.

8>>After that our program ought to expel all sets from each of the players' hands and distinguish whether the cards has been expelled.

9>> Remember ,client will get an opportunity to pick a card from the PC's hand first.

We should make CreateDeck() work that makes a standard deck of 52 cards, that could be utilized for card playing amusement.

Yield LOOKS LIKE THIS:

9 of precious stones

6 of clubs

2 of clubs

6 of precious stones

7 of hearts

5 of clubs

4 of precious stones

Ruler of precious stones

Ruler of spades

2 of hearts

8 of precious stones

Lord of clubs

Jack of precious stones

Trick card

3 of hearts

4 of clubs

Trump card

4 of hearts

7 of spades

5 of hearts

4 of spades

Trick card

Trick card

7 of clubs

10 of precious stones

3 of spades

Disposing of sets :

Expelling a couple: the 2 of clubs

also, the 2 of hearts

Expelling a couple: the 5 of hearts

also, the 5 of clubs

Expelling a couple: the 6 of clubs

also, the 6 of jewels

Expelling a couple: the Ace of jewels

what's more, the Ace of hearts

Evacuating a couple: the 3 of hearts

what's more, the 3 of spades

Evacuating a couple: the 7 of hearts

what's more, the 7 of spades

Evacuating a couple: the 4 of precious stones

what's more, the 4 of clubs

Evacuating a couple: the Queen of precious stones

what's more, the Queen of spades

Evacuating a couple: the Ace of spades

what's more, the Ace of clubs

Evacuating a couple: the 4 of hearts

what's more, the 4 of spades

Here is your hand :

8 of precious stones

Lord of clubs

Jack of precious stones

10 of precious stones

9 of precious stones

7 of clubs

I'm disposing of my sets :

Expelling a couple: the Jack of spades

what's more, the Jack of hearts

Expelling a couple: the 5 of jewels

what's more, the 5 of spades

Expelling a couple: the King of jewels

what's more, the King of hearts

Expelling a couple: the 2 of jewels

what's more, the 2 of spades

Expelling a couple: the 6 of hearts

what's more, the 6 of spades

Expelling a couple: the 3 of jewels

what's more, the 3 of clubs

Evacuating a couple: the 8 of clubs

what's more, the 8 of spades

Evacuating a couple: the 9 of hearts

what's more, the 9 of spades

Evacuating a couple: the 10 of spades

what's more, the 10 of clubs

I have 7 cards.

Which one do you pick ?

Enter a number in the vicinity of 1 and 7 : 1

Evacuating a couple: the King of clubs

also, the King of spades

You have :

9 of precious stones

7 of clubs

Jack of precious stones

10 of precious stones

8 of precious stones

I'll take card #5

Expelling a pair:the 7 of clubs

also, the 7 of precious stones

I have 5 cards.

Which one do you pick ?

Enter a number in the vicinity of 1 and 5 : 3

Evacuating a couple: the Jack of precious stones

furthermore, the Jack of clubs

You have :

8 of jewels

10 of jewels

9 of jewels

I'll take card #1

Evacuating a couple: the 9 of precious stones

furthermore, the 9 of clubs

I have 3 cards.

Which one do you pick ?

Enter a number in the vicinity of 1 and 3 : 1

You have :

Ruler of hearts

10 of precious stones

8 of precious stones

I'll take card #1

I have 3 cards.

Which one do you pick ?

Enter a number in the vicinity of 1 and 3 : 1

You have :

Ruler of hearts

8 of precious stones

10 of precious stones

I'll take card #2

I have 3 cards.

Which one do you pick ?

Enter a number in the vicinity of 1 and 3 : 1

Expelling a couple: the 8 of hearts

what's more, the 8 of precious stones

You have :

10 of precious stones

I'll take card #1

Expelling a pair:the 10 of precious stones

furthermore, the 10 of hearts

Comes about : I'M THE OLD MAID - YOU WON

hope this will work for your project

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote