Question
Rules of Golf and Little Spider Terms and Concepts of Solitare While many of you are familiar with playing cards and solitaire games, these will
Rules of Golf and Little Spider
Terms and Concepts of Solitare While many of you are familiar with playing cards and solitaire games, these will be new concepts to many other students. But for a team to be effective members must be able to communicate using shared terms. To provide this common understanding, this section describes solitaire basic concepts and terms. Playing Card All of the solitaire games you will be programming this semester uses the "standard" deck of 52 cards. Each card is identified using its "suit" and "rank". Within a single deck, there is exactly one card for each suit and rank combination (e.g., 4 suits * 13 ranks = 52 cards). Suits Standard decks have 4 suits: clubs (), diamonds (), hearts (), and spades (). Cards can also be identified with the traditional color used to draw the suit: diamonds and hearts are the red cards; clubs and spades are the black cards. Ranks In a standard deck there are 13 cards within each suit: one for each of the ranks. Twelve of the ranks have a fixed value. From lowest to smallest, these ranks 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, and King. The last rank is Ace. Most games use the Ace as the lowest card (occurring before the 2), but some games will treat the Ace as the highest card. Solitaire terms Within each solitaire game, there are multiple common concepts you will need to program. Shuffling the deck At the start of every game, and possibly during the game, you will need to "shuffle" the deck. You can find demonstrations of "perfect" shuffles online, but these are not useful for programming. For this term, shuffling is identical with placing the cards in a random order. Tableau piles Each game begins by dealing cards from the deck into the tableau piles. The number of tableau piles and how cards are dealt into each tableau pile will differ with each solitaire game. Homecell piles The goal of every solitaire game is the same: to move all of the cards into the homecell piles. But the number of homecell piles and the rules for moving cards into a homecell pile will be different for each game. Stock pile Some, but not all solitaire games, will include a stock pile. The stock pile contains the cards that have not been dealt. Each game has its own rules for how cards are dealt from the stock pile.Terms and Concepts of Solitare While many of you are familiar with playing cards and solitaire games, these will be new concepts to many other students. But for a team to be effective members must be able to communicate using shared terms. To provide this common understanding, this section describes solitaire basic concepts and terms.
Playing Card All of the solitaire games you will be programming this semester uses the "standard" deck of 52 cards. Each card is identified using its "suit" and "rank". Within a single deck, there is exactly one card for each suit and rank combination (e.g., 4 suits * 13 ranks = 52 cards).
Suits Standard decks have 4 suits: clubs (), diamonds (), hearts (), and spades (). Cards can also be identified with the traditional color used to draw the suit: diamonds and hearts are the red cards; clubs and spades are the black cards. Ranks In a standard deck there are 13 cards within each suit: one for each of the ranks. Twelve of the ranks have a fixed value. From lowest to smallest, these ranks 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, and King. The last rank is Ace. Most games use the Ace as the lowest card (occurring before the 2), but some games will treat the Ace as the highest card. Solitaire terms Within each solitaire game, there are multiple common concepts you will need to program.
Shuffling the deck At the start of every game, and possibly during the game, you will need to "shuffle" the deck. You can find demonstrations of "perfect" shuffles online, but these are not useful for programming. For this term, shuffling is identical with placing the cards in a random order. Tableau piles Each game begins by dealing cards from the deck into the tableau piles. The number of tableau piles and how cards are dealt into each tableau pile will differ with each solitaire game. Homecell piles The goal of every solitaire game is the same: to move all of the cards into the homecell piles. But the number of homecell piles and the rules for moving cards into a homecell pile will be different for each game. Stock pile Some, but not all solitaire games, will include a stock pile. The stock pile contains the cards that have not been dealt. Each game has its own rules for how cards are dealt from the stock pile.
Rules of Golf and Little Spider You should NOT be writing complete versions of either game for the first project phase. Instead your group will be graded on your writing the required test cases correctly AND that your code can then pass those tests. These instructions help clarify what is needed in each test.
Golf Golf allows ranks to "wrap around". This works like the minutes on a clock -- once we hit 59, the counting just continues back at the start with 00. In Golf, an Ace is just the rank after King and before a 2. 7 Tableau Piles Initial setup When the game begins each tableau pile should be dealt 5 cards. These cards should be face-up (but only the top one matters). Removing a Card Only the card which is currently at the top of the tableau pile can be removed. Once a card is removed, the card following it in the pile becomes the top card and can be removed. Adding a Card Once the initial setup is complete, cards cannot be added to a tableau pile. 1 Homecell Pile Initial setup When the game begins the homecell pile should be empty. Removing a Card Cards cannot be removed from the homecell pile Adding a Card It is only legal to add a card of any suit from the tableau pile to the homecell pile if the tableau pile's card has a rank just above or just below the homecell's top card. For example, a King (of any suit) from a tableau pile can be added to the homecell if the homecell's top card's rank is either Queen or Ace. An Ace (of any suit) from a tableau pile can be added to the homecell if the homecell's top card's rank is a King or 2. It is always legal to add a card from the stock pile to the homecell pile. 1 Stock Pile Initial setup The stock pile contains all of the cards except those dealt to a tableau pile. Removing a Card Only the card which is currently at the top of the stock pile can be removed. Once a card is removed, the card following it in the pile becomes the top card and would be legal to remove. Adding a Card Once the initial setup is complete, cards cannot be added to a tableau pile. Little Spider In Little Spider, an Ace is the LOWEST valued card in each suit. 8 Tableau Piles Initial setup After setting up the homecell piles, each tableau piles should be dealt 6 cards. Removing a Card Only the card which is currently at the top of the tableau pile can be removed. Once a card is removed, the card following it in the pile becomes the top card and can be removed. Adding a Card A card can be added to a tableau pile when its rank is either one below or one above than the tableau's top card. The cards' suits do not matter. When adding a card to a tableau pile, ranks can "wrap around". For example, a King (of any suit) can be added to a tableau pile if the tableau pile's current top card has a rank of either Queen or Ace. An Ace (of any suit) can be added to a tableau pile if the tableau pile's current top card has a rank of either King or 2. 4 Homecell Piles Initial setup When the game begins, 1 homecell pile should have the Ace of Diamonds, another homecell pile should have the Ace of Hearts, a third homcell pile should have the King of Clubs, and the last homecell pile should have the King of Spades. Removing a Card Only the card which is currently at the top of the homecell pile can be removed. You cannot remove the last card in the homecell pile. Once a card is removed, the card following it in the pile becomes the top card and can be removed. Adding a Card A card whose suit is Hearts or Diamonds can be added to a homecell pile if it has the identical suit as the top card AND a rank one ABOVE the homecell pile's top card. For example, the Queen of Diamonds can only be added to a homecell pile whose current top card is the Jack of Diamonds. A card whose suit is Clubs or Spades can be added to a homecell pile if it has the identical suit as the top card AND a rank one BELOW the homecell pile's top card. For example, the Queen of Spades can only be added to a homecell pile whose current top card is the King of Spades. No matter its suit, the added card becomes the homecell's new top card. 0 Stock Piles Little Spider does not have a stock pile.
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