Freecell Solver - a C library for automatically solving Freecell and some other variants of card Solitaire

Overview

The Freecell Solver Repository Root README

Freecell Solver is an open source (distributed under the MIT/Expat licence) library, written in C, for attempting to solve several variants of card Solitaire/Patience, including Freecell , Baker’s Game , Seahaven Towers , and Simple Simon . Also contained are several command-line programs that use it, and the original project also span some other code for testing and for support.

Travis-CI Build Status AppVeyor Build status

Screenshots

PySol FC Running Freecell Solver

Videos

PySolFC Solving Freecell

Repository structure

fc-solve/source/

This contains the source of the solver itself. One can use CMake to build it.

cpan/Games-Solitaire-Verify/Games-Solitaire-Verify

This is the Games-Solitaire-Verify CPAN module. For more information see:

Task-FreecellSolver-Testing

This is a CPAN module for installing the various test dependencies that are found on CPAN.

cpan/Task-FreecellSolver-Testing-MultiConfig

This is a CPAN module for installing the various test dependencies that are found on CPAN. More comprehensive.

fc-solve/arch_doc

The Freecell Solver Architecture Document. Somewhat out-of-date, but may be studied for general enlightenment.

fc-solve/presets

Some code that is used in order to calculate the built-in command-line presets, like “-l good-intentions” or “-l maliciously-obscure”. Not very documented. This code is written in parts in Perl, Bash and Mono.NET.

fc-solve/rejects

Contains code that is no longer used.

fc-solve/docs

Contains various documents that are not part of the main source distribution. Mostly specifications and planning documents.

fc-solve/benchmarks

Logs of various benchmarks of the code.

How to use the library

The external API, which is provided by freecell-solver/fcs_user.h , freecell-solver/fcs_cl.h and some other headers, is not documented, but it corresponds to the command line interface that is documented in the USAGE and the README documents, has some examples in the code, and should not be hard to use.

Related repositories and links

Issues
  • freecell-solver-6.6.0: test suite is failing

    freecell-solver-6.6.0: test suite is failing

    Yeah .. looks like somethiong is wrong

    + cd freecell-solver-6.6.0
    + /usr/bin/make -O -j48 V=1 VERBOSE=1 -C x86_64-redhat-linux-gnu test ARGS=--output-on-failure
    make: Entering directory '/home/tkloczko/rpmbuild/BUILD/freecell-solver-6.6.0/x86_64-redhat-linux-gnu'
    Running tests...
    /usr/bin/ctest --force-new-ctest-process --output-on-failure
    Test project /home/tkloczko/rpmbuild/BUILD/freecell-solver-6.6.0/x86_64-redhat-linux-gnu
        Start 1: perl_run_tests
    1/1 Test #1: perl_run_tests ...................***Failed    0.18 sec
    dbm-fc-solver
    Open failed: No such file or directory at /home/tkloczko/rpmbuild/BUILD/freecell-solver-6.6.0/run-tests.pl line 126.
    bin dbm-fc-solver dbm-fc-solver
    bin dbm-fc-solver linux-vdso.so.1
    
    
    0% tests passed, 1 tests failed out of 1
    
    Total Test time (real) =   0.18 sec
    
    The following tests FAILED:
              1 - perl_run_tests (Failed)
    Errors while running CTest
    
    opened by kloczek 17
  • compile with brew for OSX

    compile with brew for OSX

    I am trying to write a brew recipe to compile the freecell-solver on OSX.

    cmake fails without an error. can you tell me what options I need to add?

    class FreecellSolver < Formula
      desc "Solitaire Solver library"
      homepage "https://fc-solve.shlomifish.org/"
      url "https://fc-solve.shlomifish.org/downloads/fc-solve/freecell-solver-6.0.1.tar.xz"
      # https://fc-solve.shlomifish.org/downloads/fc-solve/freecell-solver-5.24.0.tar.xz
      sha256 "9f1a4c6d5c8ac54c6619b3b988efb5562d460cd048d33345e52a0c849fd0d9df"
      revision 1
      
      def install
        args = std_cmake_args
        args << "-DBUILD_TESTING=OFF"
        args << "-DKDE_INSTALL_QMLDIR=lib/qt5/qml"
        args << "-DKDE_INSTALL_PLUGINDIR=lib/qt5/plugins"
        args << "-DCMAKE_INSTALL_BUNDLEDIR=#{bin}"
    
        mkdir "build" do
          system "cmake", "..", *args
          system "make"
          system "make", "install"
          prefix.install "install_manifest.txt"
        end
      end
    end
    
    opened by mjobin-mdsol 13
  • missing source file in 6.0.0

    missing source file in 6.0.0

    6.0.0 fails to configure with a missing source file error

    CMake Error at CMakeLists.txt:587 (ADD_LIBRARY):
      Cannot find source file:
    
        fcs_is_ss_true_parent.c
    
      Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
      .hpp .hxx .in .txx
    
    opened by antonio-rojas 7
  • An improper locking due to the unreleased lock before program exit

    An improper locking due to the unreleased lock before program exit

    Hi developers, in the below codes, the lock instance->fcc_exit_points_output_lock could be not released before program's exit abort();. I think it is better to write fcs_lock_unlock(&instance->fcc_exit_points_output_lock); before the abort(); for better resource management and code symmetry. Thanks!

    https://github.com/shlomif/fc-solve/blob/45efed24104b1c3ac80efb44904579d0fb238ae4/fc-solve/source/split_fcc_solver.c#L455-L478

    Best,

    opened by ycaibb 4
  • Convert cmake config to GNUInstallDirs

    Convert cmake config to GNUInstallDirs

    @a17r : hi, are you happy with the changes in this branch: https://github.com/shlomif/fc-solve/tree/cmake-gnu-install-dirs--feature-branch . Please review and tell me if you approve. Thanks!

    opened by shlomif 4
  • Build fails: missing Shlomif_Common.cmake

    Build fails: missing Shlomif_Common.cmake

    cmake fails with: `$ cmake . CMake Error at CMakeLists.txt:5 (INCLUDE): INCLUDE could not find load file:

    Shlomif_Common
    

    CMake Error at CMakeLists.txt:7 (SHLOMIF_COMMON_SETUP): Unknown CMake command "SHLOMIF_COMMON_SETUP". ` The needed file is ignored in .gitignore but after digging through the git history I found it in your bitbucket. Cloning that and copying the needed file, and now I have a different problem, perl dependencies.

    opened by scresante 4
  • You tried to plan twice

    You tried to plan twice

    The test suite of Games-Solitaire-Verify-0.2301 fails on a few of my smoker systems:

    You tried to plan twice at t/exception-newline.t line 11.
    # Looks like your test exited with 2 before it could output anything.
    t/exception-newline.t ..... 
    Dubious, test returned 2 (wstat 512, 0x200)
    Failed 2/2 subtests 
    
    opened by eserte 3
  • Suggestions about error handlings for locking

    Suggestions about error handlings for locking

    Hi, developers, I have a suggestion about error handlings for locking. Would it be better to handle the possible errors that return from pthread_mutex_lock.

    For example, this example does not check the value returned by pthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquire the mutex for any reason, the function may introduce a race condition into the program (CWE-413).

    The manners of error handlings could be flagging any warnings or returning before accessing the critical region.

    void f(pthread_mutex_t *mutex) {
    pthread_mutex_lock(mutex);
    
    /* access shared resource */
    
    
    pthread_mutex_unlock(mutex);
    }
    

    https://github.com/shlomif/fc-solve/blob/45efed24104b1c3ac80efb44904579d0fb238ae4/fc-solve/source/lock.h#L71-L74

    opened by ryancaicse 2
  • Add a compile-time option for the offloading queue to use Amazon S3 instead of a local disk

    Add a compile-time option for the offloading queue to use Amazon S3 instead of a local disk

    See https://en.wikipedia.org/wiki/Amazon_S3 - this should be cheper than allocating extra hard disk space locally at Amazon EC2 instances. Now the question is where to find a good API for C or C++.

    enhancement 
    opened by shlomif 2
  • Bump terser from 5.14.0 to 5.14.2 in /fc-solve/site/wml

    Bump terser from 5.14.0 to 5.14.2 in /fc-solve/site/wml

    Bumps terser from 5.14.0 to 5.14.2.

    Changelog

    Sourced from terser's changelog.

    v5.14.2

    • Security fix for RegExps that should not be evaluated (regexp DDOS)
    • Source maps improvements (#1211)
    • Performance improvements in long property access evaluation (#1213)

    v5.14.1

    • keep_numbers option added to TypeScript defs (#1208)
    • Fixed parsing of nested template strings (#1204)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump jquery-ui from 1.13.1 to 1.13.2 in /fc-solve/site/wml

    Bump jquery-ui from 1.13.1 to 1.13.2 in /fc-solve/site/wml

    Bumps jquery-ui from 1.13.1 to 1.13.2.

    Release notes

    Sourced from jquery-ui's releases.

    jQuery UI 1.13.2 Released!

    https://blog.jqueryui.com/2022/07/jquery-ui-1-13-2-released/

    Commits
    • d6c028c 1.13.2
    • 8cc5bae Checkboxradio: Don't re-evaluate text labels as HTML
    • b53e7be All: Remove deprecated .click() usage in demos/tests
    • bb00536 Build: Update AUTHORS.txt
    • 9d1fc97 Datepicker: Capitalize some Indonesian words
    • 1f467ba Selectmenu: Remove a call to the deprecated .focus() method
    • ac1866f Build: Update AUTHORS.txt
    • 395aa7d Datepicker: Add missing localization for prevText and nextText
    • 218c6af Datepicker: Remove symbols in localization
    • 3126e12 Datepicker: Remove symbols in localization
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Owner
Shlomi Fish
I'm an Israeli software developer, writer and humorist. You can learn more about me from the pages of my home site (link below).
Shlomi Fish
Online version of the greatest card game known to man

10Flips Online version of the greatest card game known to man Client The client is made using Emscripten. Installing # Get the emsdk repo git clone ht

Oskar Mendel 2 Oct 26, 2021
NeoGB Printer an SD card-based standalone Game Boy Printer emulator.

An open-source and standalone Gameboy Printer emulator 100% compatible with all officially released games (110 in total) that support the accessory. Just print and save the images as BMP

Rafael Zenaro 65 Jul 27, 2022
Card game with Objective-C using Allegro 4/5

Card game with Objective-C using Allegro 4/5 , This is an alternative of the real game for personal reasons .

Cerbah Kamel 3 Nov 7, 2021
Magarena is a single-player fantasy card game played against a computer opponent.

Magarena is a single-player fantasy card game played against a computer opponent.

MagArena 351 Jul 20, 2022
TeeWare is a Teeworlds mod based on DDNet, inspired by the other mods TF2Ware and SRB2Ware

TeeWare is a Teeworlds mod based on DDNet, inspired by the other mods TF2Ware and SRB2Ware, which are also inspired by the WarioWare game series by Nintendo.

Headshot 7 Jul 14, 2022
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

Jolt Physics Library A multi core friendly rigid body physics and collision detection library suitable for games and VR applications. A YouTube video

null 2k Aug 8, 2022
A simple and easy-to-use library to enjoy videogames programming

raylib is a simple and easy-to-use library to enjoy videogames programming. raylib is highly inspired by Borland BGI graphics lib and by XNA framework

Ray 10.2k Jul 31, 2022
Pure C math library for 2D and 3D programming

MATHC MATHC is a simple math library for 2D and 3D programming. Features Vectors (2D, 3D and 4D) (integer type and floating-point type) Quaternions Ma

Felipe da Silva 600 Jul 27, 2022
SubLink is a C++ library used for constructing and analyzing merger trees in numerical simulations of galaxy formation

README SubLink is a C++ library used for constructing and analyzing merger trees in numerical simulations of galaxy formation. Brief description SubLi

nelson-group 1 Jan 20, 2022
A Binary Clock. Written 3 different ways. C and SDL, Python and PyGame, Python and PyGame Zero.

Super Clock A Binary Clock. Written 3 different ways. Python with PyGame Zero, Python with PyGame and C with SDL2. Time is displayed in 3 groups of 8

null 3 Dec 8, 2021
🎨 Modern 2D/3D - Importer • Exporter • Util - Library, also called (AssetIO)

Brand-new modern 3D asset importer, exporter library. This library will include common 3D utils funcs. It is written with C99 but C++ wrappers or othe

Recep Aslantas 150 Jun 8, 2022
Epoxy is a library for handling OpenGL function pointer management for you

Epoxy is a library for handling OpenGL function pointer management for you. It hides the complexity of dlopen(), dlsym(), glXGetProcAddress(), eglGetP

Eric Anholt 553 Aug 1, 2022
A C math library targeted at games

Kazmath Kazmath is a simple 3D maths library written in C. It was initially coded for use in my book, Beginning OpenGL Game Programming - Second editi

Luke Benstead 503 Jul 28, 2022
A library for high-performance, modern 2D graphics with SDL written in C.

SDL_gpu, a library for making hardware-accelerated 2D graphics easy. by Jonathan Dearborn SDL_gpu is licensed under the terms of the MIT License. See

Jonathan Dearborn 1k Jul 29, 2022
VE Font Cache is a single header-only GPU font rendering library designed for game engines.

VE Font Cache is a single header-only GPU font rendering library designed for game engines. It aims to: Be fast and simple to integrate. Take advantag

Xi Ma Chen 341 Jul 3, 2022
Godex is a Godot Engine ECS library.

Godex Godex is a Godot Engine ecs library. Disclaimer: this module is still in development, open an issues to report any problem or a new discussion i

GodotECS 687 Aug 4, 2022
C++ library for multi-physics simulation

Project Chrono represents a community effort aimed at producing a physics-based modelling and simulation infrastructure based on a platform-independent, open-source design.

null 1.5k Aug 3, 2022
River Rade game written in C using Ncurses library

river-rade Move your plane with arrow keys or A-D keys To install Ncurses library(on debian based): sudo apt-get install libncurses5-dev libncursesw5-

Narges Najian 3 Dec 1, 2021
A single-header C++ library for making simple 2D games

A single-header C++ library for making simple 2D games PLATFORM: Windows LANGUAGE: C++ ENVIRONMENT: Visual Studio Why? Learning C++ is often seen as d

Sumo Digital Academy 44 Jul 28, 2022