Question: Assignment Requirments in C++ You will be required to implement a card deck and the game of solitaire in C++ using the console window to

 Assignment Requirments in C++ You will be required to implement a

Assignment Requirments in C++

You will be required to implement a card deck and the game of solitaire in C++ using the console window to show the playing board. The game will be implemented as follows:

Use MUST use stacks or queues (your choice) to store the card deck, the discard pile, the 7 playing area piles, and the 4 sort piles.

You MUST write a custom stack and queue class using a linked-list implementation that you wrote.

The Standard Template Library may NOT be used for these data structures (stack / que / linked-list).

The stack or queue MUST store the cards in the following format: Card Number or Letter followed by the Suite Letter.

The Card Numbers (from lowest to highest): A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K

The Suites: H, D, C, S

Examples: 10 of Diamonds = 10D, Ace of Spades = AS, Queen of Hearts = QH

You MUST implement the UI as shown below.

Your game must look like this with nice formatting. Hint: [1] setw() function

You must implement the options specified (how is up to you)

1: Moves a selected card to the sort pile of its suite (If a valid move) Hint: Exception Handling)

2: Move a card or cards from specified pile or discard to some other pile (If a valid Move)

3: Flip cards in discard pile

You MUST implement all of the rules of the card game Solitaire as stated in introduction section.

You MUST additionally write a custom shuffle function to randomize the cards before play starts.Hint: Use the rand()[2] function with a seed from computers clock to perform randomization.

Uses standard library and time library: and

The cards are not random each flip. As soon as the deck is randomized once it will stay in that order throughout the game.

You MUST write a function to print out the cards in the deck.

You MUST write a function to sort the cards in increasing order: A,A,A,A,2,2,2,2.K,K,K.KYou may use the following algorithms to perform the sort: Bubble Sort, Selection Sort, Insertion Sort, Quick Sort, Merge Sort, Heap Sort

Note: You must write the code for the algorithms yourself. No STL or other library.

You MUST write a function to sort he cards in decreasing order: K,K,K,K,Q,Q,Q,Q,J,J,J,J.2,2,2,2,A,A,A,A

Same rules for the increasing sort applies.

You MUST do the following before the start of the game:Print out deck order by suite (How you should initialize the array)

For example: AH,2H,3HKH,AD,2D,3D,KD.KSKC

Sort the deck in increasing order and print out to screen.

Sort the deck in decreasing order and print out to screen.

Shuffle (randomize) the deck and print out to screen.

Then you may begin the game logic.

You MUST display a victory or game over (lost game) message which also displays the users final score.

Yuu MUST display a victury or game over(tamelusr-whialsu displays the user's final ASSIGNMENT REQUIRMENTS You will be uie to impleenta card deckand thegame uf sulitaire in Cig the console window to show the playing hoard. The game will be implemented as fnllows: Sample Start nf Game Screen Use MUST use stacks or queues (your cholce) to store the card deck, the discard pile, the 7 playing urea piles, uni the i surt piles Yu MUST write a custom stack and queue class usinga inked list implementation that you wrote linked-list) followed by the Suite Letter oThe Standard Teplate Library may NOT be used Tor Liese data structures [stack /aua/ The stack or quauc MUST stare the cards n the following format: Card Numher or I.cter The Card Numbers [from lowest to highest]: A, 2, 3, 4, 5, 6,7, ,9, 10,1.Q, K -The Suttes: H, D, C,S Examples: 10 of Diamonds 1D, Ace of Spades-AS, ueen of Hearts QH You MUST ilemeat the UI as shown below. Sample Game A Few Muves Later Your game must look like this with nice formatting. Hint: eamaupp sepeQ function You must implement the ontlons spectfied [how Is up to you) 1: Moves a selected card to the sort pile of its suite(ra valid move) Hint: Exception landling) . e 1: Pile 2:KS PLle 3:Pile 4: PileS:PPile Ple 7 2: Move a card ar cards from specified plic or discard to se ather pile [Ifa valtd Move] 3: lip cards in discard pile RC .You MUST implement all nf the rules of the card game Solitaire as stated in intraduction sectinn .You MUST additionally write a custom shuftle tuncion to randomize the cards before play starts Hint: Use the unerli function with a seed from computer's clock to perform randumization. Uses standard library and time library: stdlibe and tine The cards are not random each fitp. As saon stay in that order throughout the game. . thc deck is randomized ance it will You MUST write a function to print out t You MUST WTite a function to snrt the cards in increasing order. AAAA 22 a he cards in the deck. K,K,KK . You may use the tollowing algortthms to perform the sort: Bubble Sort, Selection Sort, lsertion Surt, Quick Sor, Merge Surt Heap Sor. o Nate: You must write the code for the algorith ms yourselE. Na STL or other library. You MUSI wie a fanction to sort ho cards tn decreasing ordeT: KKKaouii 2,2,2,2,AAAA .You MUST do the following before the start of the game Print out deck order hy sut na shauld tn tlazc the array) For example: AHH3..KHAD ZD,3D KD. KS KC o Surt the dekin increasing urder and print uut to screen o Sort the deck in decreasing arder and print nut to screen Shuftle (randomtze) the deck and print out to scroen o Then you may begin he gabe logic. I0 Mantpulati brary+am http//www.cplusplus.com/referenccflomantp Band0 C+com: bttp:/www.cplusplus.com/reference/cstdlib/frand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!