Freecell Solver
This is Freecell Solver - a program that automatically solves layouts of Freecell and similar variants of Card Solitaire such as Eight Off, Forecell, and Seahaven Towers, as well as Simple Simon boards. Freecell Solver is free and open source software freely available under the MIT/X11 License. It is written in ANSI C and requires a C compiler to be built. Nevertheless, binaries for Microsoft Windows 32-bit are available.
Included with the archive is source code for programs that can automatically feed it with the boards of several popular Solitaire Implementations.
Freecell Solver can also be built as a library for use within your own Solitaire implementations. A more detailed list of features can be found in the Features List.
News
30-May-2013: Freecell Solver 3.18.0 was Released: JavaScript port
Freecell Solver version 3.18.0, has been released. Freecell Solver 3.18.0 is available in the form of a source archive, from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.
The highlights of this version are the new port to JavaScript, courtesy of the wonderful emscripten compiler from LLVM to JavaScript, that allows Freecell Solver to run inside modern browsers, as well as the fact that the test suite and the relevant now work on 32-bit systems (previously they only worked on 64-bit ones).
Enjoy!
See comments and comment on this.
01-Apr-2013: Freecell Solver Enterprises™ Acquires Google Inc.
1 April, 2013, Tel Aviv, Israel: Due to the spectacular commercial success of Freecell Solver Enterprises™’s Enterprise Edition and its Webscale™ edition, we have amassed quite a bit of cash in the bank, so we decided to make a small but important strategical acquisition. As a result, Freecell Solver Enterprises™ is proud to announce its upcoming acquisition of Google Inc., which will result in an exciting synergical merger.
Some of the upcoming changes would be replacing Google’s tech support (which is notoriously bad) by Freecell Solver Enterprises™’s world-famous and superb tech support (as detailed in the essay “Seven steps to remarkable customer service” by Joel on Software), as well as integrating Google search into Freecell Solver™ for an enhanced experience in solving Freecell. We are also planning on creating a separate YouTube top-level category for card Solitaire-related videos (including screencasts and presentations).
We are sure that the upcoming acquisition is going to allow Freecell Solver Enterprises™ to further its competitive edge, and allow us to have even more significant growth, which will in turn allow us to make even more significant acquisitions. As our CTO, Shlomi Fish, notes: “good times are coming.”.
Soon, people will say “Let’s Freecell Solver Enterprises™ Superheroic Web Search™ it!” instead of “Let’s Google it!”, for an exciting Web 3.141592™ experience.
See comments and comment on this.
10-Dec-2012: Freecell Solver 3.16.0 was Released + New Screencast
Freecell Solver version 3.16.0, has been released. Freecell Solver 3.16.0 is available in the form of a source archive, from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.
This new release took about a month to prepare, and also contains less profound changes than the previous release, but still quite a lot to look for. It features the -l micro-finance-improved and -l qualified-seed presets, which improve upon the average solution length (at the expense of speed). The --flares-choice flag was added and one can specify --flares-choice fcpro to choose based on the lenght of the Freecell Pro moves. Another additional flag is --flares-iters-factor which multiplies the time the flares run at by a factor for a speed/solution-length trade-off.
Finally, the inidividual flares are now recycled and their memory is reused when they are no longer needed which yields a RAM optimisation in certain cases.
More information about all these can be found in the distributed documents of Freecell Solver.
In addition to all that, a new screencast of PySolFC solving Freecell using Freecell Solver is now available on YouTube. Make sure you expand the details for all the credits of the software and other material that was used for its creation.
Enjoy and happy holidays.
See comments and comment on this.
04-Nov-2012: Freecell Solver 3.14.1 was Released
Freecell Solver version 3.14.0, shortly followed by Freecell Solver 3.14.1, which fixed a build problem on Microsoft Windows, have been released. Freecell Solver 3.14.1 is available in the form of a source archive, and a Win32 self-installing executable, from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.
This release features several new features: we added a 6th Best-First-Search weight of the inverse of the number of cards not above parents, which has proven useful. We now also allow test groups inside the --tests-order and --depth-tests-order with the random-dfs scan to be ordered using the function =asw(…) based on those BeFS weights.
As a result, the preset -l amateur-star or -l as for short has been added, that uses that and is our fastest preset yet. Another new preset is -l micro-finance (or -l mf for short), which yields especially short solutions.
There are also some not-as-major features: input boards can now contain a leading colon (":") at the beginning of the line of columns, so they can be copy-and-pasted directly from the output of fc-solve with the -p flag. The dbm_fc_solver and depth_dbm_fc_solver now store the positions more compactly (which aided in researching two-freecell deals), and the core libfreecell-solver code was made more 64-bit enabled and many of the limits were converted to 64-bit friendly ones.
A final note: we have dropped support for building Freecell Solver with Microsoft Visual C++ and other non-GCC compatible compilers, which do not support the newer C standards, and other useful features of GCC. Building Freecell Solver with GCC, clang and other compatible compilers will be continued to be supported on Microsoft Windows as well as on Linux and other UNIX-like systems.
More information about all these can be found in the distributed documents of Freecell Solver.
Enjoy!
See comments and comment on this.
02-Sep-2012: Two Freecell Solvability Report for the First 400,000 Deals
With some help from some people on the fc-solve-discuss list and off the list (namely Amadiro from the University of Oslo and someone else that I met on IRC , I ran my solvers on the first 400,000 Windows Freecell deals with only two available freecells to see how many of them can be solved.
Here is the report:
| Start Index | End Index | Solved | Impossible | Intractable |
|---|---|---|---|---|
| 1 | 32,000 | 25,381 | 6,619 | 0 |
| 32,001 | 50,000 | 14,302 | 3,698 | 0 |
| 50,001 | 100,000 | 39,775 | 10,225 | 0 |
| 100,001 | 400,000 | 238,415 | 61,584 | 1 (No. 384243) |
| Total | 317,873 | 82,126 | 1 | |
So about 79.47% of the deals can be solved and the rest are impossible. The only intractable deal that none of my solvers could yield a verdict for is No. 384,243, and it spans a very large number of states:
-
The dbm_fc_solver got into
Reached 12,821,000,000 ; States-in-collection: 13,620,999,440
before it failed to produce more results due to a limitation of the hardware where it was deployed on. -
The depth_dbm_fc_solver yielded this:
Reached 13,763,700,000 ; States-in-collection: 16,226,294,490 ; Time: 1345126456.520408 Queue Stats: inserted=16,226,294,490 items_in_queue=2,462,594,490 extracted=13,763,700,000
with a curr_depth of 38. However, that solver may have some yet undiscovered bugs.
So what's next? I’d like to investigate some ways to scale to a larger number of states, perhaps by creating a distributed solver. A google search for distributed breadth first search yields some results:
I hope you enjoy the statistics for the time being.
See comments and comment on this.
13-Jun-2012: Freecell Solver 3.12.0
Freecell Solver version 3.12.0 has been released. It is available in the form of a source archive from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.
The first item to note is that the URL of its site changed from under *.berlios.de to http://fc-solve.shlomifish.org/, and that there is a redirect in place. Moreover, we have switched the version control system from one based on Subversion to a git repository which is currently hosted on GitHub (though we may move it later).
This release adds a new flag - --show-exceeded-limits or -sel for short, that removes some ambiguity in the output, and fixes a problem with starting the solver with --set-pruning r:tf in conjunction with -opt. A new preset - -l three-eighty (or -l te for short) has been added, which provides somewhat better performance.
The experimental dbm_fc_solver is now less experimental and can now store the positions inside binary trees in memory, and its memory consumption has been greatly reduced since earlier versions. We also added another experimental solver called fcc_fc_solver which aims to determine the solvability of a deal by analysing fully-connected-components (“FCCs”).
We also added support for building and testing the distribution in an out-of-tree build, and there are some cleanups to the code.
More information about all these can be found in the distributed documents of Freecell Solver.
Enjoy!
See comments and comment on this.
15-Jan-2012: Freecell Solver 3.10.0 was Released
Freecell Solver version 3.10.0 has been released. It is available in the form of a source tarball from the download page.
This release fixes two bugs - one with the --max-iters affecting only the last instance, and one with reading foundations with 0, and implements many small optimisations and cleanups. It also adds some experimental code with the so-called delta-states, where states are compactly encoded based on the original state. This functionality is not available in the main solver yet, but it powers the experimental on-disk-key/value-databases-based solver, which end up not scaling very well during testing.
Enjoy!
See comments and comment on this.
Previous News Items
Links
- Freecell.org - a web-site dedicated to the game.
- Michael Keller's Freecell site - contains the Freecell FAQ (Frequently Asked Questions) and other stuff.
- PySol Fan Club Edition - a cross-platform, open-source implementation of many Solitaire games with very good embedding of Freecell Solver.
- An unsolvable instance of Freecell - why not all possible initial Freecell boards can be solved.
- Justin-Heyes Jones' A* page - a page about the A* scan.
- patsolve - a program by Dr. Tom Holroyd that solves Freecell and Seahaven Towers games. There are some fundamental differences between its architecture and that of Freecell Solver, so it might be worthwhile to take a look. I've done some modifications on it to fix some build bugs.
- Freecell Solver’s Freecode App-Index Record
- Freecell Solver's Mailing-List (at YahooGroups).
- The Freecell Solver Blog
- A Presentation about Freecell Solver

