question archive Java Data structure: Using the standard solitaire game, Klondike, suggest an implementation using stacks, queue or list or combination of any of the three

Java Data structure: Using the standard solitaire game, Klondike, suggest an implementation using stacks, queue or list or combination of any of the three

Subject:Computer SciencePrice:2.87 Bought7

Java Data structure:

Using the standard solitaire game, Klondike, suggest an implementation using stacks, queue or list or combination of any of the three. Be specific in how it will handle the different aspects of the game. Note: Klondike is the standard version of solitaire, most commonly played and typically included in the Windows OS. An example is shown here:http://worldofsolitaire.com/

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Answer Preview

Answer:

LIST :

  • We will need to make a lot of lists.
  • 7 lists for the cards to show.
  • 4 different lists to place the correct suited cards.
  • 1 list for keeping the rest of the deck and show only three cards at a time.
  • For the cards in the 7 lists.
    Only cards that are already placed there can stay there from the beginning.
    Or 'K' can be placed at any empty spot, and rest of the list of the cards will be beneath it.
  • For the 4 lists, cards will only move to their respective suite, and 1 by 1 in increasing order.
  • For the list of the rest of the cards, we only need to keep track of the 1 card at the top, and show the rest of the cards 3 or less (if only less than 3 cards remain) at a time.