Solitaire Pseudocode
- Create vector of suits.
- Create vector of values.
- Use loop to generate a deck of 52 cards.
- Use function to shuffle cards.
- Sort the cards into 7 column vectors with 1 card in the first vector, 2 in the second, 3 in the third, etc.
- Pile rest of the cards into a stack (another vector).
- Reveal the last card in each vector and the top most card from the stack.
- Ask user to input card they want to move, then input number of the stack they want to move it to, or “f” to move the card to a foundations pile.
- If the move is valid, execute by adding the card that is moved to the new pile and removing the card from its previous pile. Or, if “f” was entered, move the card to the appropriate foundations pile according to suit.
- Else print “Invalid move.”
- Repeat steps 8 through 10 until user enters “draw” when they believe they do not have any moves left.
- Reveal another card from the stack that replaces previous revealed card.
- Go back to 11.
- Whenever stack empties, refresh by adding all cards back to the stack from the discarded pile.
- Game ends when user believes there are no moves left.