My first stab at a programming puzzle:
A variation of the card game patience is played according to the following rules:
Four cards are dealt face up on the table.
If two (or more) of the cards share the same face value, then the card furthest to the right is picked up and placed face up on the card of the same value. Once all possible movements have been made, four new cards are dealt face up on the existing piles (or any spaces created by card movements).
Still with me? OK...
Once the deck is exhausted, the four piles are picked up and piled together starting from the right hand side, so the far right hand pile ends up at the bottom and the far left hand pile at the top. The object of the game is to finish with the deck arranged into 13 groups of four (they do not have to be in numerical order).
The questions therefore are:
1. From a randomly shuffled deck, is there a maximum number of moves required to finish the game?
2. Is it possible to finish every game?
Let me know if anything needs explaining better (I'm betting it will need it!)
Geraint
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all
A variation of the card game patience is played according to the following rules:
Four cards are dealt face up on the table.
If two (or more) of the cards share the same face value, then the card furthest to the right is picked up and placed face up on the card of the same value. Once all possible movements have been made, four new cards are dealt face up on the existing piles (or any spaces created by card movements).
Still with me? OK...
Once the deck is exhausted, the four piles are picked up and piled together starting from the right hand side, so the far right hand pile ends up at the bottom and the far left hand pile at the top. The object of the game is to finish with the deck arranged into 13 groups of four (they do not have to be in numerical order).
The questions therefore are:
1. From a randomly shuffled deck, is there a maximum number of moves required to finish the game?
2. Is it possible to finish every game?
Let me know if anything needs explaining better (I'm betting it will need it!)
Geraint
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all