Index of /Files/files/dirs/fcs-c-source

      Name                                        Last modified      Size  Description
Parent Directory - dondorf-king.bmp 2018-09-05 06:19 36K fc-solve-icon.xcf 2018-09-05 06:19 36K fc-solve.ico 2018-09-05 06:19 69K include/ 2019-07-23 06:31 - COPYING.asciidoc 2020-05-29 06:38 3.0K INSTALL.asciidoc 2020-05-29 06:38 2.9K prefix.h.in 2020-05-29 06:38 109 COPYING.txt 2020-06-17 09:58 3.0K HACKING.asciidoc 2020-06-17 09:58 8.8K card.c 2020-06-17 09:58 1.0K cl_callback_common.h 2020-06-17 09:58 2.7K cl_callback_range.h 2020-06-17 09:58 2.2K dbm_bdb.c 2020-06-17 09:58 3.6K dbm_calc_derived_iface.h 2020-06-17 09:58 1.5K dbm_hashtable.h 2020-06-17 09:58 1.5K dbm_trace.h 2020-06-17 09:58 668 default_iter_handler.h 2020-06-17 09:58 1.6K delta_states.c 2020-06-17 09:58 2.4K delta_states_debondt.c 2020-06-17 09:58 2.6K delta_states_iface.h 2020-06-17 09:58 762 fc_pro_iface_aux.c 2020-06-17 09:58 1.5K fcc_brfs_test.h 2020-06-17 09:58 1.0K fcs_user_internal.h 2020-06-17 09:58 1.5K gen_ms_boards__find_deal.h 2020-06-17 09:58 507 gen_ms_boards__hll_iface.c 2020-06-17 09:58 1.2K gen_ms_boards__hll_iface.h 2020-06-17 09:58 948 generic_tree.h 2020-06-17 09:58 1.4K hacks_for_hlls.c 2020-06-17 09:58 1.4K indirect_buffer.h 2020-06-17 09:58 882 iter_handler_base.h 2020-06-17 09:58 1.3K kaz_tree.h 2020-06-17 09:58 6.0K main_cl_callback_common.h 2020-06-17 09:58 9.5K move_funcs_order.h 2020-06-17 09:58 896 move_stack_compact_alloc.h 2020-06-17 09:58 1.5K multi_fc_solve_main.c 2020-06-17 09:58 796 rand.h 2020-06-17 09:58 1.2K rank2str.h 2020-06-17 09:58 1.4K read_state.h 2020-06-17 09:58 1.3K render_state.h 2020-06-17 09:58 1.5K split_cmd_line.h 2020-06-17 09:58 893 trim_trailing_whitespace.h 2020-06-17 09:58 1.1K try_param.h 2020-06-17 09:58 931 var_base_int.h 2020-06-17 09:58 2.0K gen_boards_lib.c 2020-07-01 16:14 615 meta_alloc.c 2020-09-07 09:45 1.9K main.c 2021-09-05 12:14 693 dbm_common.h 2021-10-14 12:05 1.4K dbm_apr_hash.c 2021-10-15 02:25 2.1K dbm_kaztree_compare.h 2021-10-15 02:34 1.8K xxHash-wrapper/ 2021-12-10 22:14 - rinutils/ 2022-11-30 03:37 - AUTHORS.asciidoc 2022-11-30 05:14 6.7K NEWS.asciidoc 2022-11-30 05:14 56K TODO.asciidoc 2022-11-30 05:14 7.3K USAGE.asciidoc 2022-11-30 05:14 39K asprintf-1.0/ 2022-11-30 05:14 - calc_foundation.h 2022-11-30 05:14 1.4K check_and_add_state.c 2022-11-30 05:14 12K cl_callback.h 2022-11-30 05:14 3.5K cmd_line.c 2022-11-30 05:14 29K config.h.in 2022-11-30 05:14 5.6K dbm_cache.h 2022-11-30 05:14 5.6K dbm_calc_derived.h 2022-11-30 05:14 21K dbm_calc_derived_test.c 2022-11-30 05:14 4.4K dbm_kaztree.c 2022-11-30 05:14 4.2K dbm_leveldb.cpp 2022-11-30 05:14 2.9K dbm_lru_cache.h 2022-11-30 05:14 1.5K dbm_move_to_string.h 2022-11-30 05:14 1.4K dbm_procs.h 2022-11-30 05:14 17K dbm_procs_inner.h 2022-11-30 05:14 6.2K dbm_solver.c 2022-11-30 05:14 25K dbm_solver.h 2022-11-30 05:14 4.3K dbm_solver_head.h 2022-11-30 05:14 1.7K deals_populator.h 2022-11-30 05:14 3.7K delta_states.h 2022-11-30 05:14 4.5K delta_states_any.h 2022-11-30 05:14 2.2K delta_states_debondt_impl.h 2022-11-30 05:14 18K delta_states_impl.h 2022-11-30 05:14 13K delta_states_test_common.h 2022-11-30 05:14 1.7K depth_dbm_procs.h 2022-11-30 05:14 2.8K depth_dbm_solver.c 2022-11-30 05:14 13K depth_multi_queue.h 2022-11-30 05:14 3.8K fc_pro_iface.c 2022-11-30 05:14 7.4K fc_pro_iface_pos.h 2022-11-30 05:14 1.6K fc_pro_range_solver.c 2022-11-30 05:14 6.7K fcs_back_compat.h.in 2022-11-30 05:14 2.1K fcs_base64.h 2022-11-30 05:14 3.2K fcs_hash.h 2022-11-30 05:14 4.7K fcs_hash__insert.h 2022-11-30 05:14 5.1K forking_range_solver.c 2022-11-30 05:14 8.9K freecell-solver.spec.in 2022-11-30 05:14 7.6K freecell.h 2022-11-30 05:14 1.9K game_type_limit.h 2022-11-30 05:14 541 game_type_params.h 2022-11-30 05:14 3.1K google_hash.cpp 2022-11-30 05:14 6.2K google_hash.h 2022-11-30 05:14 1.6K handle_parsing.h 2022-11-30 05:14 3.6K instance.c 2022-11-30 05:14 17K instance.h 2022-11-30 05:14 26K instance_for_lib.h 2022-11-30 05:14 2.6K internal_move_struct.h 2022-11-30 05:14 2.5K libfreecell-solver.pc.in 2022-11-30 05:14 350 lock.h 2022-11-30 05:14 3.6K measure_depth_dep_tests_order_performance.c 2022-11-30 05:14 6.6K meta_alloc.h 2022-11-30 05:14 3.6K meta_move_funcs_helpers.h 2022-11-30 05:14 10K move.c 2022-11-30 05:14 3.1K move.h 2022-11-30 05:14 11K move_funcs_order.c 2022-11-30 05:14 7.0K multi_cl_callback.h 2022-11-30 05:14 2.9K offloading_queue.h 2022-11-30 05:14 11K output_to_file.h 2022-11-30 05:14 5.2K pqueue.h 2022-11-30 05:14 5.3K preset.c 2022-11-30 05:14 6.4K preset.h 2022-11-30 05:14 1.1K print_time.h 2022-11-30 05:14 2.2K pruner-main.c 2022-11-30 05:14 2.5K pseudo_dfs_atomic_moves_solver.c 2022-11-30 05:14 12K pseudo_dfs_cache.h 2022-11-30 05:14 4.7K range_solvers.h 2022-11-30 05:14 2.7K range_solvers_binary_output.h 2022-11-30 05:14 4.3K run-tests.pl 2022-11-30 05:14 8.9K scans.c 2022-11-30 05:14 25K scans_impl.h 2022-11-30 05:14 16K set_weights.h 2022-11-30 05:14 1.4K simpsim.c 2022-11-30 05:14 35K simpsim.h 2022-11-30 05:14 1.5K split_cmd_line.c 2022-11-30 05:14 6.8K state.c 2022-11-30 05:14 11K threaded_range_solver.c 2022-11-30 05:14 4.7K trace_mem.h 2022-11-30 05:14 2.5K var_base_reader.h 2022-11-30 05:14 2.4K var_base_writer.h 2022-11-30 05:14 2.6K ver.txt 2022-11-30 05:14 6 zerofc_freecell_moves.h 2022-11-30 05:14 4.1K Presets/ 2023-06-06 09:27 - man/ 2023-06-06 09:27 - t/ 2023-06-06 09:27 - CMakeLists.txt 2024-01-30 06:27 51K fcs-libavl/ 2024-01-30 06:27 - freecell.c 2024-01-30 06:27 48K split_fcc_solver.c 2024-01-30 06:27 29K kaz_tree.c 2024-04-04 02:05 40K scans.h 2024-04-04 02:05 5.6K state.h 2024-04-04 02:05 34K sys/ 2024-04-04 02:05 - patsolve/ 2024-04-04 22:28 - lib.c 2024-04-06 22:13 147K cmake/ 2024-04-09 06:52 - freecell-solver.spec 2024-04-09 06:52 7.6K fc-solve.txt 2024-04-17 18:26 45K HACKING.html 2024-04-17 18:26 12K fc-solve.xml 2024-04-17 18:26 67K TODO.xml 2024-04-17 18:26 10K COPYING.xml 2024-04-17 18:26 3.1K USAGE.html 2024-04-17 18:26 63K USAGE.xml 2024-04-17 18:26 59K COPYING.html 2024-04-17 18:26 3.9K TODO.html 2024-04-17 18:26 10K AUTHORS.xml 2024-04-17 18:26 11K AUTHORS.html 2024-04-17 18:26 10K INSTALL.xml 2024-04-17 18:26 4.5K NEWS.xml 2024-04-17 18:26 90K INSTALL.html 2024-04-17 18:26 5.4K HACKING.xml 2024-04-17 18:26 11K fc-solve.6 2024-04-17 18:26 47K NEWS.html 2024-04-17 18:26 82K asciidoctor.css 2024-04-17 18:26 28K board_gen/ 2024-04-17 18:53 - gen_ms_boards__rand.h 2024-04-17 18:53 2.1K range_solvers_gen_ms_boards.h 2024-04-17 18:53 4.0K scripts/ 2024-04-17 18:53 - serial_range_solver.c 2024-04-17 18:53 4.9K summarizing_solver.c 2024-04-17 18:53 3.4K
Freecell Solver Readme File

Introduction

This is Freecell Solver version 6.8.x, a program that automatically solves most layouts of Freecell, and similar Solitaire variants as well as those of Simple Simon.

Freecell Solver is distributed under the MIT/Expat License ( http://en.wikipedia.org/wiki/MIT_License ), a free, permissive, open-source license.

Note that the Freecell Solver source and Win32 binary distributions do not provide a graphical user-interface (GUI) and are primarily meant to be used by Solitaire researchers and software developers. If you’re looking for a suitable GUI based on Freecell Solver, see our links at:

I hope you’ll enjoy using Freecell Solver, and make the best of it.

 — Shlomi Fish ( http://www.shlomifish.org/ )

Building

Read the file INSTALL.txt for information on how to do that.

Usage

The program is called "fc-solve". You invoke it like this:

fc-solve board_file

board_file is the filename with a valid Freecell startup board. The file is built as follows:

It has the 8 Freecell stacks.

Each stack contains its cards separated by a whitespace and terminated with a newline character( it’s important that the last stack will also be terminated with a newline !). The cards in the line are ordered from the topmost card (= the card right on the virtual table and the one with the most cards placed on it) in the left, to the bottommost card in the right (= the card with no other cards placed on it).

A card string contains the rank of the card followed by its suit. The card number is one of: A,1,2,3,4,5,6,7,8,9,T,J,Q,K. Alternatively, 10 can be used instead of T, but using that is discouraged and is only supported for backward compatibility. The card suit is one of: H,S,D,C (standing for Hearts, Spades, Diamonds and Clubs respectively).

Here is an example board: (PySol/Microsoft board No. 24)

4C 2C 9C 8C QS 4S 2H
5H QH 3C AC 3H 4H QD
QC 9S 6H 9H 3S KS 3D
5D 2S JC 5C JH 6D AS
2D KD TH TC TD 8D
7H JS KH TS KC 7C
AH 5S 6S AD 8H JD
7S 6C 7D 4D 8S 9D

Visually, it appears as this:

Freecell Deal No. 24

As can be seen, the four of clubs (4C), five of hearts (5H), etc. are at the bottom of the stacks and the start of the lines in the board input.

And another one: (PySol board No. 198246790)

KD JH 5H 7D 9H KC 9D
3H JD 5D 8H QH 7H 2D
4D 3S QC 3C 6S QS KS
TC 9S 6D 9C QD 8S TD
TS 8C 7S TH 2C AS
8D AC AH 4H JC 4C
6H 7C 4S 5S 5C JS
AD KH 6C 2H 3D 2S

Starting from Freecell Solver 3.14.x, a stack can also start with a leading colon (":"). This is to allow input from states as output by Freecell Solver using the -p option.

You can specify the contents of the freecells by prefixing the line with "FC:" or with "Freecells:". For example:

FC: 3H QC

will specify that the cards 3 of hearts and queen of clubs are present in the freecells. To specify an empty freecell use a "-" as its designator.

If there’s another "FC:" line, the previous line will be overridden.

You can specify the contents of the foundations by prefixing the line with "Founds:" or with "Foundations:" and then using a format as follows:

Founds: H-5 C-A S-0 D-K

Hence, the suit ID followed by a dash followed by the card number in the foundation. A suit that is not present will be assumed to be 0. Again, if there’s more than one line like that, then the previous lines will be ignored and overridden.

The program will stop processing the input as soon as it read 8 lines of standard stacks. Therefore, it is recommended that the foundations and freecells lines will come at the beginning of the file.

The program will process the board and try to solve it. If it succeeds it will output the states from the initial board to its final solution to the standard output. If it fails, it will notify it.

For information about the various command-line switches that Freecell Solver accepts, read the USAGE.txt file in this directory.

To solve Simple Simon boards append --game simple_simon right after the "fc-solve" program name.

The board generation programs

Several programs which can generate the initial boards of various Freecell implementations can be found in the "board_gen/" sub-directory. Read the README.txt file there for details on how they can be compiled and used.

In any case, they can save you the time of inputting the board yourself.

Some complete examples for layouts

A layout in the middle of the MS Freecell deal No. 109 solution:

Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  2S  KD
: 8H 3D
: KS QD JC
: AS 8D TD 7D JH TS 9D
: 7S 6D
: 5S
: KH QC JD TC 9H 8S 7H 6S 5D 4S
: KC QH JS TH 9S
: 4D

Similar, but with an empty Freecell:

Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  -  KD
: 8H 3D 2S
: KS QD JC
: AS 8D TD 7D JH TS 9D
: 7S 6D
: 5S
: KH QC JD TC 9H 8S 7H 6S 5D 4S
: KC QH JS TH 9S
: 4D

Likewise, only without leading colons where unnecessary:

Foundations: H-6 C-9 D-2 S-0
Freecells:  QS  3S  -  KD
8H 3D 2S
KS QD JC
AS 8D TD 7D JH TS 9D
7S 6D
5S
KH QC JD TC 9H 8S 7H 6S 5D 4S
KC QH JS TH 9S
4D

How to read the solutions

The file USAGE.txt covers all of Freecell Solver’s command line options, but it may be too exhaustive for casual users. As a result, here is a shorter tutorial. First of all whenever invoking fc-solve one should add the flags -p -t -sam -sel which will make the solution easier to understand. Then, assuming the board could be successfully solved, one will be given the layouts in the solution (in the format given above) vis-a-vis with the moves as the string. Note that the indexes of the resources given in the moves are 0-based rather than the more natural 1-based notation.