FS#7955 - Bug in solitaire when Drawing Three Cards

Attached to Project: Rockbox
Opened by Matthias Fasching (fasmat) - Sunday, 14 October 2007, 19:59 GMT
Last edited by Jens Arnold (amiconn) - Saturday, 08 March 2008, 13:51 GMT
Task Type Bugs
Category Plugins
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


There's a bug in the solitaire plugin. I found it on the iPod, but probably it happens on all targets:

When you start a game with Drawing Three Cards, it is possible to take every card of the 3 and put it on fitting cards on one of the piles. When you for instance draw 9, K and J you can place the king on an empty pile, and so Drawing Three Cards is as easy as Draw One Card.

Hope someone finds the time to fix it.
This task depends upon

Closed by  Jens Arnold (amiconn)
Saturday, 08 March 2008, 13:51 GMT
Reason for closing:  Fixed
Comment by Peter D'Hoye (petur) - Saturday, 27 October 2007, 22:03 GMT
Do tell in more detail how you manage to pick another card than the top one in draw three mode.... I can't
Comment by Daniel Nitsche (DangerousDan) - Saturday, 24 November 2007, 00:38 GMT
I can confirm this, it has to do with the code for "smarter" moving of cards introduced in revision 13248. That piece of code automatically tries to move the previous card if the first move fails. This works fine for ordinary card columns, since the previous card is the one under the selected card, but when it acts on the remains pile the outcome can sometimes be highly unpredictable.

You can try this out by starting a new game with "Draw Three Cards". When the top card is not a king (there's a special case for kings in the code) you can move the previous cards from the remains pile to a card column by selecting the topmost card and clicking on the desired destination. Assuming that the move is legal for one of the cards visible on the remains pile, the move will be carried out.

This particular issue can of course be solved by adding another special case for when the source card is in the remains pile, but there may be other issues also caused by this feature, I haven't studied the code in depth.