# Solitaire Puzzle

This one shouldn't be too hard.

Preparation stage: Take a shuffled deck of standard playing cards and deal 13 face-down piles of 4 cards each. Pick up each pile, arrange the order of the cards however you like, and put it back face-down before moving on to the next pile. Once you put a pile back, you can't return to it. Once you have gone through all the piles, turn the top card of each pile face-up.

Playing stage: Stack cards by putting lower cards on top of consecutive higher cards of the same suit. You can move a whole stack of consecutive cards. You can have at most 13 piles. If you ever have less than 13 piles, you can move a stack with a king at the bottom to the empty spot. If a face-down card is ever at the top of a pile, turn it face-up. You win if you can get down to 4 piles (which will be the king-to-ace sequence for each suit).

What strategy in the preparation stage will guarantee victory? (Let me know if the game rules aren't clear).

EDIT: It is currently unclear if there is a way to guarantee victory. The answer pointing this out is the currently accepted answer. A strategy which is proven to guarantee victory OR a proof of no such strategy existing are welcome.

• You can only move cards to the next number up of the same suit? So 6h can only go on the 7h? Or do you have the same rules as normal solitaire where you can move on to an opposing colour? – Andrew Smith Apr 17 '15 at 0:26
• 6h can only go on 7h. The playing stage is trivial, the real game takes place in the preparation stage. – Caleb Apr 17 '15 at 0:27

## 2 Answers

It does not look like it is possible to guarantee victory.

Reversing Emrakul's answer, I came up with the following scenario that is not winnable under the terms of the puzzle. You would need to swap the 4d and 7d in order for it to be solvable.

By the time you have seen the 8d,5d,6d pile, it is too late for you to go back and swap the order of the 4d and 7d.

9c 9d 9h ac 7h kh kc qc 8d qs jc 0c 7c as ad ah 2c 4s kd 8c 5c 5d ks jh qh 0h 2s 2d 2h 3c 5s 7d 6c 0d 6d 0s jd 5h 8h 3s 3d 3h 9s 6s 4d 4c 4h 7s 8s js qd 6h

• You lose with this strategy if a card is on top of a lower valued card of the same suit. – Aza Apr 17 '15 at 0:42
• @Emrakul clarified it slightly, I meant value from 1-52 not 1-13 – Andrew Smith Apr 17 '15 at 0:44
• In what scenario? – Andrew Smith Apr 17 '15 at 0:47
• K,k,k,k,j,j,j,j,9,9,9,9,7 face up would cause it to fail – Andrew Smith Apr 17 '15 at 1:00
• @CalebBernard Your example does not fail under my solution – Andrew Smith Apr 17 '15 at 1:24

Place the cards in sequential order from low on top to high on bottom, where spades are 1-13, hearts are 14-26, diamonds are 27-39, and clubs are 40-52, with one exception:

If encounter sequential cards of the same suit, reverse them.

For instance, if you encounter $A_s, 2_s, 4_d, 9_c$, put them in the order $2_s, A_s, 4_d, 9_c$. That way, if the three of spades $3_s$ comes up, you'll be able to play the 2 of spades on it, then the ace.

The exception is critically important. Without it, you'll bury an 8 under a 7, and won't be able to move it. However, if you reverse it, when the 6 comes up, you move the 7, then the 8 is exposed.

If you do this, you're guaranteed to win. The next spades are guaranteed to come up, because you'll always be able to move the top card somewhere else.

• so if you encounter As,2s,3s,9c - you sort them as 3s,2s,As,9c and As,2s,4s,9c would be 2s,As,4s,9c ? – Andrew Smith Apr 17 '15 at 1:48
• @Andrew Precisely! – Aza Apr 17 '15 at 1:56
• @Emrakul this doesn't seem winnable: 9c 9d 9h 9s 7h kh kc qc 8d qs jc 0c 7c as ad ah ac 4s kd 8c 0d 5d ks jh 5h 0h 2s 2d 2h 2c 5s 7d 6c 5c 6d 0s jd qh 8h 3s 3d 3h 3c 6s 4d 4c 4h 7s 8s js qd 6h – Andrew Smith Apr 17 '15 at 2:14
• Added it to my answer so that it is formatted – Andrew Smith Apr 17 '15 at 2:17
• @Andrew What is the zero of clubs? – Aza Apr 17 '15 at 2:24