Klondike solitaire game in Java
Taking a shuffled standard 52-card deck of playing cards (without Jokers), one upturned card is dealt on the left of the playing area, then six downturned cards (from left to right).
On top of the downturned cards, an upturned card is dealt on the left-most downturned pile, and downturned cards on the rest until all piles have an upturned card. The piles should look like the figure to the right.
The four foundations (light rectangles in the upper right of the figure) are built up by suit from Ace (low in this game) to King, and the tableau piles can be built down by alternate colors, and partial or complete piles can be moved if they are built down by alternate colors also.
Any empty piles can be filled with a King or a pile of cards with a King. The point of the game is to build up a stack of cards starting with 2 and ending with King, all of the same suit.
Once this is accomplished, the goal is to move this to a foundation, where the player has previously placed the Ace of that suit. Once the player has done this, they will have "finished" that suit- the goal being, of course, to finish all suits, at which time the player will have won.