Description for the requirements for the program are as listed are below. :
In this project you are going to write the code to implement the card game Crazy Eights, using a linear data structure to represent the deck of cards.
-There should be separate .h and .cpp files for all the classes in addition to your main program source code file.
-The Deck class must contain a linear data structure that you have coded yourself – you MAY NOT use the STL library for this data structure and you MAY NOT use an array. In addition to the pointer to the top of the linked structure of cards, your Deck class should maintain a size variable indicating how many cards are in the deck. Your Deck class should have the following member functions:
• A fill() function to initialize the Deck to contain the standard 52 playing cards found in a deck of cards: (Ace, 2, 3 … 10, Jack, Queen and King in suits Hearts, Diamonds, Clubs and Spades). If you wish to represent the 10 card as a T instead, e.g. T♥ would be the ten of hearts, then you are free to do so.
• A drawCard() function to remove the top card from the Deck and return it.
• A removeCard() function to find a specific card and remove it from the Deck.
• An addCard() function to insert a new card into the Deck.
• A shuffle() function to randomize the order of the cards in the Deck. You will implement a simulation of a standard riffle shuffle based on the Gilbert-Shannon-Reeds model. To perform one riffle, you will split the deck into two halves (stored in two Deck objects) – you should split the original deck by taking the first 50% of the cards and placing them on one Deck object and then put all of the remainder on a second Deck object: don’t alternate putting the cards on the two half decks. You will then loop through randomly choosing a card from one of the two half decks. If the first half deck contains x cards and the second half deck contains y cards, then with probability x/(x + y) you will pull a card from the first half deck onto the original deck, otherwise you will pull a card from the second half deck. Your shuffle function should riffle the cards seven times to fully randomize the order.
• You must include a destructor and copy constructor to clean up properly after your code. Note that if there’s an error in your destructor or copy constructor code, it may well cause the program to crash immediately after it appears to finish.