Question: Solitaire Prime - Prog 1 CECS 282-os- Spring 2018 Due: Feb 13, 2018 Solitaire is a card game that is played by one person. Solitaire


Solitaire Prime - Prog 1 CECS 282-os- Spring 2018 Due: Feb 13, 2018 Solitaire is a card game that is played by one person. Solitaire is also known by the name "Patience". It is estimated that there are more than 1700 different versions of Solitaire... make that 1701 because we are inventing a new Solitaire game today. Welcome to Solitaire Prime! This game uses one standard deck of cards. Here are the rules: 1) Take the top card from the deck and place it face up on the table. 2) The sum is now the value of that card (Ace-1, 2-2, 10-10, Jack = 10, Queen = 10, King-10) If the Sun is a prime number, discard that pile (hand), and start over at instruction #1 3) 4) If the Sum is not prime, take the next card from the top of the deck and place it on top of the card stack (pile or hand) on the table. The Sum is now the sum of all cards in the stack on the table. 5) 6) Go to instruction #3. Continue to play the game, keeping track of how many "hands" you have created that are prime. If the last card from the deck gives you a prime hand, then you win! Write the word "Winner" on the screen and show how many prime hands there were. If the last card from the deck does not give you a prime hand, then you lose. Write the word "Loser" in the screen These 2 screen shots show possible winner and loser hands if I were using just 13 cards (I am using a mini-deck that only has Spades) Notice that each time a card is dealt, the card is displayed and the current sum of the hand is displayed as well. When you acquire a Prime Hand, print out the value (prime number) and start over on the next line. ts/visual studi." 10 mentslvisual studi. cusers S
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
