Question: use the card and deck classes to make a simple solitaire card.The program should print the state of print statements and enter commands from the

use the card and deck classes to make a simple solitaire card.The program should print the state of print statements and enter commands from the user with input statements.The solitaire card has the following rules: -You have 9 seats.The solitaire card starts with drawing a card from the deck for each slot and placing it on this slot.-For each round you can lay two or three cards, in different slots, with the following rules: oTo lay two cards, the sum of the value must be the cards that are already in the two slots must be 11.

To lay three cards, the cards that are already in all three slots must be picture cards (jack, queen and / or king)

-The solitaire card goes up when you have used up the deck.If you have no places you can legally lay, the solitaire card does not go up.

a) Import the classes Card and Deck from my examples

b) Create a class for the game itself. This class should have instance variables for the deck and the 9 slots.

c) The designer of the game class must make a new deck, make the 9 slots, draw cards from the deck and place them on the 9 slots

d) Create a method write_condition that prints what is in the 9 places and how many cards are left in the deck

e) Create a method that checks if the game is finished. It must returnTrue if the deck is empty and False otherwise

f) Create a method for placing two cards. The method must take the numbers of the two places as parameters. The method must check that this is a legal location. If it is a legal placement, the method must draw two new cards from the deck and place them on the two slots .

g) Create a method for placing three cards similar to the one for two cards

h) Create a code that allows the user to play the solitaire card using the class and methods from the previous sub-tasks. This can either be a method in the game class or part of the if __name__ == __main__ block. The solitaire card must end when the deck is empty with a message that the solitaire card has gone up. It is not mandatory to check that there are no legal places to post.

i) Create an if __name__ == __main__ block that starts the game.

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!