Solvitaire - The solitaire solver  cards

Frequently Asked Questions

Privacy policy

When you launch Solvitaire, and periodically thereafter, it sends your MachineGUID to the Solvitaire server so that it can track installations. This unique ID is generated by Windows at install time and is purely used for system identification. It does not encode any private information about you or your system.

When you purchase a license then the Solvitaire server records the details of the PayPal transaction, in order to be able to verify your license. None of these details are ever shared with anyone except PayPal.

How do I purchase or transfer a license?

Licensing is done through the Settings->License... menu option in the Solvitaire app. This will bring up a web page that will walk you through purchasing or transferring a license.

Your PC is automatically registered as soon as the Paypal transaction completes. Just restart Solvitaire and it will pick up the details from the server.

What are the items under the Settings menu?

You can use the Settings menu to configure some of the features of Solvitaire.

How does Solvitaire work?

Solvitaire uses an approach that I would describe as constrained brute force with repetition avoidance.

Brute Force

Start with simple brute force, which involves going through all valid moves one by one, stepping back when there are no more valid moves and it has not found a solution. This would, for some variants, take many years to complete one game.

Repetition avoidance

Using brute force it is possible to arrive at the same card layout via a difference sequence of moves. As a simple example, moving a card from a to b and then back from b to a is often a valid move. Solvitaire eliminates this repetition by checking that no arrangement of cards matches one that has been previously tried. It does this by creating a 64 bit "hash value" that represents the current card layout.

64 bits is not enough to represent all possible arrangements because if the value of each card in a pack was represented by 6 bits then it would require a 312 bit integer to encode the sequence of cards in a pack. (Yes, you could get it down to 52! but the processing power to do the encoding would far outweigh the memory saving.) Anyway a 64 bit hash seems to eliminate duplicates without preventing too many solutions from being found. (Every game presented by Microsoft Solitaire Collection has been solved, with the exception of the insoluble ones - see below.)

Solvitaire uses about a quarter of the available memory on your PC to store a lookup table containing the state hashes.

Constraining the search

Finally the depth of the brute force search is constrained by allocating "credit" to each type of move and backing up the search if the credit gets exhausted when following a particular path. For most games the credit is fixed for each move type. For Spider solitaire the credit scoring is more complex.

The progress bars

progressbars

The upper two progress bars need little explanation. How long Solfitaire has been running and the total number of moves attempted.

Solvitaire calculates moves until it either (a) reaches a solution or (b) needs to move cards to expose one that it has not yet read. The "depth" bar shows, for the current state of the cards in Solitaire Collection, how many moves have to be backed out (in blue) and then how many new moves need to be made (in orange) to get from the current card state to the currently calculated position.

The "credit" bar shows the current state of the credit, used to constrain the searching. The orange section identifies the base credit that has currently been allocated (which is increased by 30 points for each new attempt at a solution) and the green section indicates the amount of credit remaining for the current state of the calculations.

Why is there a skip insoluble games option if all the GrandMaster games are soluble?

It appears that Microsoft Solitaire Collection serves up some insoluble games for Klondike solitaire with the 3 card deal option. During testing I encountered a game which was provably insoluble (there were only a couple of valid moves you could make).

How long does it take to solve a game?

Calculating the solution is generally fast (a few seconds), but it does take time to play through the cards in order to be able to calculate the solution. (You can see from the status icon that Solvitare is mostly walking through moves rather than doing calculations.)

There are, however, some games of Spider and Klondike that take significantly more time to calculate the solution. Of the 2000+ games currently in the Solvitaire regression test suite the longest solution takes about 40 minutes to calculate.

Microsoft Solitaire Collection serves up some insoluble games for Klondike solitaire with the 3 card deal option. I spend some time trying to find a bug in Solvitaire until I skipped over a few and came to one which was clearly insoluble (there were only a couple of possible valid moves before failure).

Does Solvitaire store the solutions?

For each solved game, the initial card layout and the solution are stored on your hard drive. You will find these in \users\%username%\appdata\roaming\Solvitaire\Games\%variety%. The card layout is saved in cardsnnn (the deal and deck) and the solution is in solution_cardsnnn.

Where do I find the debug information?

If you turn on logging then you will find the results in \users\%username%\appdata\roaming\solvitaire\trace. You will also find diagnostic screenshots in this directory, if Solvitaire has a problem identifying a card or skipping over an advert etc.

Can I use Solvitaire to solve my own deal?

Solvitaire has a mode where you can load up a card file and get a solution for it, or load a card/solution combination to just step through the solution. Yes, see under "Introduction" for the format of the input file you must provide to run your own games. You can choose a challenge type (eg remove 3 kings) if you want a solution that is other than just clearing the board.

Why does solving a Spider score challenge give an "end your current game" warning

The solutions to challenges all assume you are starting from a clean slate. If Spider needs to do any backtracking when working out the solution then it will lose points and so a playback of the final solution would not reach the target score. To complete the level with the saved solution Solvitaire clicks on the "Try Again" button and accepts the warning before playing through the the solution to achive the expected score.

Does Solvitaire have an API

Yes, you can launch a special version of the app which has a console which accepts input from stdin and prints responses to stdout. The app is solvitairec.exe which by default is installed in the \program files\solvitaire directory. An empty line to stdin produces the following output.

# Supported commands:
# mode msft              // Control microsoft solitaire collection
# mode play              // Play a game
# version [klondike <1|3> | spider <1|2|4> | freecell | pyramid | tripeaks]
# difficulty [easy | moderate | hard | seed <number>]
# deal                   // Generate a new game in play mode
# readcards <filename>   // Load and deal a card file
# solve                  // Solve currently loaded cards
# step [N]               // Step forwards [N moves]
# run                    // Step through the whole solution
# list <filename>        // Print the current solution <to file>
# reset                  // Exit game and reset
# tracelevel <1-9>       // Set the logging level
API:
If you wish to use the API then try entering these commands manually to see what they do.