

Move an exposed card onto a pile in the layout, only legal when.Move an exposed card to its legal place in a foundation, no worrying.The top cards of the waste and layout piles are exposed. It's a double-pack game starting with empty foundations, to be built ace-upwards an empty waste pile and a layout of ten pre-dealt face-up piles of four cards each. To focus our ideas, let's take a particular example: Forty Thieves. Since solitaire games vary so much, reasoning at this level of generality is itself hard. However, cheaper algorithms such as starting from a winning position and making random "un-moves" to reverse the game back to a starting point may have biases toward particular deck shuffles that are very hard to quantify or avoid.Īre there any interesting algorithms or research in the area of generating winnable games like this? The problem with this is that (2) is hard (maybe NP-hard depending on the game) and even approximations of it are computationally expensive (if you're on an iPad, say). This method of randomly generating possibilities and picking from them is always a good starting point when you're trying to avoid having subtle selection bias creep in to your result. Then it would be possible to generate a set of "well distributed" winnable solitaire deals by generating a large set of starting decks with (1) and then filtering them down to the winnable set with (2). A magic function WINNABLE(D) which takes the shuffled deck and returns True if the deck D is winnable by some playing sequence, or False if it inevitably results in a losing position.A good shuffling algorithm (a good source of randomness plus a method of shuffling not subject to any of the common pitfalls which would bias the result).
