Answered step by step
Verified Expert Solution
Question
1 Approved Answer
python -You have 9 seats. The solitaire card starts by drawing a card from the deck for each slot and placing it on this slot.
python -You have 9 seats. The solitaire card starts by drawing a card from the deck for each slot and placing it on this slot. -For each round you can lay 2 or 3 cards, in different places, with the following rules .To lay 2 cards, the sum of the value of the cards already in the 2 slots must be 11 .To lay 3 cards, the cards that are already in all 3 places 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 lay, the solitaire card does not go up.
Import class 1. Create a class for the game itself. This class should have instance variables for the deck and the 9 slots. 2.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 3. Create a method write_condition that prints what is in the 9 slots and how many cards are left in the deck. 4. Create a method that checks if the game is finished. It must return True if the deck is empty and False otherwise 5 Create a method for placing 2 cards. The method should take the numbers of the 2 places as parameters. The method should check that this is a legal location. If it is a legal placement, the method must draw 2 new cards from the deck and place them on the 2 slots. 6. Create a method for placing 3 cards similar to the 1 for 2 cards 7. Create code that allows the user to play the solitaire card. 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started