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
  • 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
  • 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 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] 0
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
A Sudoku solver made in C++ using SDL for graphics.

sudoku_solver A Sudoku solver made in C++ using SDL for graphics. What is a Sudoku puzzle? Sudoku puzzles have been around for a very long time, origi

null 1 Nov 12, 2021
Source Code for "Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs" by Eric Haines and Tomas Akenine-Möller

Apress Source Code This repository accompanies Ray Tracing Gems: High-Quality and Real-Time Rendering with DXR and Other APIs by Eric Haines and Tomas

Apress 862 Dec 29, 2022
3D engine from scratch (without OpenGL or any other 3D graphics library)

Simple 3d engine based on SFML library. I tried to make this engine powerful and easy to understand.

Vectozavr 64 Dec 10, 2022
Brand new engine with new and QoL features. Grafex is Psych engine with some additions and Better graphics

Friday Night Funkin' - Graphex Engine Credits: Grafex Mod aka Psych Graphic Rework: Xale - Lead Coding, Artist PurpleSnake - Second Coder Psych Engine

Xale 2 Jan 7, 2023
This Project Implement an interactive camera for 3D model using Quaternion. It have some advantages over eulerian camera like no gimbal lock and faster to compute.

Quaternion-Camera This Project Implement an interactive camera for 3D model using Quaternion. It have some advantages over eulerian camera like no gim

Phan Sang 8 Nov 10, 2022
Spatial extrapolation algorithm: calculate the data of other regions through the data of known regions.

Spatial interpolation Author : csl E-Mail : [email protected] OverView Spatial interpolation is often used to convert the measured data of discrete po

null 1 Oct 18, 2021
ANSI C library for NURBS, B-Splines, and Bézier curves with interfaces for C++, C#, D, Go, Java, Lua, Octave, PHP, Python, R, and Ruby.

TinySpline TinySpline is a small, yet powerful library for interpolating, transforming, and querying arbitrary NURBS, B-Splines, and Bézier curves. Th

Marcel Steinbeck 895 Dec 28, 2022
StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR!

StereoKit is an easy-to-use open source mixed reality library for building HoloLens and VR applications with C# and OpenXR! Inspired by libraries like XNA and Processing, StereoKit is meant to be fun to use and easy to develop with, yet still quite capable of creating professional and business ready software.

Nick Klingensmith 730 Jan 4, 2023
Draco is a library for compressing and decompressing 3D geometric meshes and point clouds.

Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.

Google 5.4k Dec 30, 2022
A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.

null 2.5k Jan 4, 2023
DirectX 11 and 12 library that provides a scalable and GCN-optimized solution for deferred shadow filtering

AMD ShadowFX The ShadowFX library provides a scalable and GCN-optimized solution for deferred shadow filtering. Currently the library supports uniform

GPUOpen Effects 163 Dec 9, 2022
The official Open-Asset-Importer-Library Repository. Loads 40+ 3D-file-formats into one unified and clean data structure.

Open Asset Import Library (assimp) A library to import and export various 3d-model-formats including scene-post-processing to generate missing render

Open Asset Import Library 8.6k Jan 4, 2023
A modern cross-platform low-level graphics library and rendering framework

Diligent Engine A Modern Cross-Platform Low-Level 3D Graphics Library Diligent Engine is a lightweight cross-platform graphics API abstraction library

Diligent Graphics 2.6k Dec 30, 2022
A multi-platform library for OpenGL, OpenGL ES, Vulkan, window and input

GLFW Introduction GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development. It provides a simple, platf

GLFW 10k Jan 1, 2023
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal

Low Level Graphics Library (LLGL) Documentation NOTE: This repository receives bug fixes only, but no major updates. Pull requests may still be accept

Lukas Hermanns 1.5k Jan 8, 2023
Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.

This project is not actively maintained. NanoVG NanoVG is small antialiased vector graphics rendering library for OpenGL. It has lean API modeled afte

Mikko Mononen 4.6k Jan 2, 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
A terminal-based graphics library for both 2D and 3D graphics.

TermGL A terminal-based graphics library for both 2D and 3D graphics. Written in C, created for terminals supporting ANSI escape codes. Table of Conte

null 215 Dec 28, 2022