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

Comments
  • 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 29
  • 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
  • Bump json5 from 2.2.1 to 2.2.2 in /fc-solve/site/wml

    Bump json5 from 2.2.1 to 2.2.2 in /fc-solve/site/wml

    Bumps json5 from 2.2.1 to 2.2.2.

    Release notes

    Sourced from json5's releases.

    v2.2.2

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Changelog

    Sourced from json5's changelog.

    v2.2.2 [code, diff]

    • Fix: Properties with the name __proto__ are added to objects and arrays. (#199) This also fixes a prototype pollution vulnerability reported by Jonathan Gregson! (#295).
    Commits
    • 14f8cb1 2.2.2
    • 10cc7ca docs: update CHANGELOG for v2.2.2
    • 7774c10 fix: add proto to objects and arrays
    • edde30a Readme: slight tweak to intro
    • 97286f8 Improve example in readme
    • d720b4f Improve readme (e.g. explain JSON5 better!) (#291)
    • 910ce25 docs: fix spelling of Aseem
    • 2aab4dd test: require tap as t in cli tests
    • 6d42686 test: remove mocha syntax from tests
    • 4798b9d docs: update installation and usage for modules
    • 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] 4
  • 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
  • sscanf safety check

    sscanf safety check

    Hello, as I've seen in all of your sscanf's(and other functions from this family) you are checking for return value and processing invalid data. There's only one exception there. It's this sscanf.

    As you know much more about design of this tool I kindly ask you to check if it's ok.

    opened by B1Z0N 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 85 Dec 22, 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 358 Dec 9, 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 8 Aug 17, 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 2.5k Dec 31, 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 11.3k Jan 4, 2023
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 624 Dec 30, 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 162 Dec 21, 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 578 Dec 30, 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 506 Dec 31, 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 1.1k Dec 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 340 Dec 7, 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 767 Jan 9, 2023
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.6k Dec 29, 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 63 Dec 22, 2022