# Solitaire no-win states [duplicate]

This question already has an answer here:

NOTE: SIMILIAR TO Solitaire Dreams - Creating a winnable solitaire starting hand

Find a minimum of 5 deck orders where if the cards were dealt out would create a game of Klondike Solitaire where there is absolutely no possible winning state. Assume the game is 3 card draw, infinite times through the deck.

As always, the shorter the program the better.

## marked as duplicate by Peter Taylor, Johannes Kuhn, John Dvorak, Doorknob♦, manatworkAug 26 '13 at 6:12

• Solutions to Solitaire Dreams - Creating a winnable solitaire starting hand could be edited into solutions to the core of this with one character change, and making them repeat 5 times doesn't add anything. – Peter Taylor Aug 21 '13 at 7:38
• @PeterTaylor given that the only answer given to the duplicate question is also a cheating one, I don't think it is obvious this is actually a duplicate. – John Dvorak Aug 21 '13 at 7:53

# J, 37 (or 0; see below) characters

(i.5)A.(52\$'cdsh'),.4#'kqajt98765432'


For a much better view, prepend ,"2 and change the suits to uppercase. For an even better view, prepend ,"2' ',"1 instead. For more decks, change i.5 to a higher value, up to at least 24 factorial (6.2*10^23).

The trick here is twofold: Make the piles solid (enough) with (enough) aces built safe within, and to do that easily. If we deal the standard unshuffled deck, there is one rank that is never exposed. Let's move the aces there. There are several possible moves depending on the color assignment, but in order to prevent exposing the easy ace, order the colors such that this move is not possible. We are dealt this tableau (black colors in uppercase):

kC kd kS kh qC qd qS
qh aC ad aS ah jC
jd jS jh tC td
tS th 9C 9d
9S 9h 8C
8d 8S
8h


The only moves possible are

• qh-kC exposing kd
• tS-jd/jS-qh freeing diamonds up to 8d (if the stock is good)
• 8h-9S exposing 8S
• 8d-foundation/9h-tS or 8d-9S/9h-tS exposing 9C.

When these moves are performed, we're left with this solid tableau:

kC kd kS kh qC qd qS
qh    aC    aS ah jC
jS    jd    jh tC td
tS    th 9C 9d
9h    9S    8C
8h    8S


The eight of hearts can be moved between the two black nines and the cards from the deck can be stacked on top, but no more aces can be freed.

Now, we can replace 8h, 8S and even 8h with a different card in the the stock and the game stays unwinnable. This pushes the number of known unwinnable decks up to 27! at least. Removing 8C opens up additional moves, but I believe the game is still unwinnable.

Note that if merely discovery is sufficient, then my score is zero as I didn't need a computer to verify the unwinnability of these 27! decks.

• Or, if you want to be especially evil, find a solution involving every draw-three player's nightmare - an ace on the 1st, 4th, 7th, and 10th cards in the stockpile. – Joe Z. Aug 22 '13 at 13:12