Question: Python You will use the card and deck classes from the lecture videos to make a simple solitaire card. The program should print the state
Python You will use the card and deck classes from the lecture videos to make a simple solitaire card. The program should print the state of print sentences and enter commands from the user with input sentences. The solitaire card has the following rules: - You have 9 places. The solitaire card starts with drawing a card from the deck and for each slot put it in this place. - For each round you can lay two or three cards, in different places, with the following rules: o To lay two cards, the sum of the value of the cards already lying on the two the seats be 11 o To lay three cards, the cards that are already in all three slots must be picture cards (jack, queen and / or king) - The solitaire goes up when you have used up the deck. If you have no places you can legally add, the solitaire does not go up. Sub-tasks a) Import the classes Card and Deck from my examples b) Create a class for the game itself. This class shall have instance variables for the deck and the 9 the places. c) The designer of the game class will make a new deck of cards, make the 9 seats, draw cards from the deck and place them in the 9 slots d) Create a method write_modity that prints what is in the 9 places and where many cards left in the deck e) Create a method that checks if the game is finished. It must return True if the deck is empty and False otherwise f) Create a method for placing two cards. The method should take the numbers of the two places that parameters. The method should check that this is a legal location. If it's a legal one placement, the method shall 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 code that allows the user to play the solitaire using the class and methods from the previous ones the sub-tasks. This can either be a method in the game class or part of if __name__ == __Main__ blocks. The solitaire card must end when the deck is empty with the message that the solitaire has gone up. It is not mandatory to check that there are no legal places to lay. i) Create an if __name__ == __main__ block that starts the game.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
