Skip to content

turingfan/ReSolvitaire

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

992 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solvitaire: A general solver for perfect-information solitaire games

License: GPL v2 GitHub release DOI All Contributors

Building and Running

Solvitaire requires a C++14 compiler, CMake 3.14+, and the Boost libraries. The compiled Boost component needed is program_options; several header-only components (multi_index, optional, pool, property_tree, random) are also used and are included automatically with any standard Boost installation. The primary development branch is dev, which is tested on macOS (Apple Silicon) and Linux (x86_64 / arm64).


(a) macOS

Prerequisites (Homebrew):

brew install cmake boost

Build:

./build.sh                          # release build (default)
./build.sh --release --unit-tests   # also build test binary

Test:

cd cmake-build-release
ctest -R '^unit_tests$' --output-on-failure

Run:

./cmake-build-release/bin/solvitaire --type klondike --random 42

(b) Linux

Prerequisites (Ubuntu 22.04 / Debian):

sudo apt-get install build-essential cmake libboost-program-options-dev git python3

Build:

./build.sh                          # release build
./build.sh --release --unit-tests   # also build test binary

Test:

cd cmake-build-release
ctest -R '^unit_tests$' --output-on-failure

Run:

./cmake-build-release/bin/solvitaire --type klondike --random 42

(c) Container (Linux build on macOS or any host)

Requires the Apple container CLI, Docker, or Podman.

Build image and run unit tests:

./scripts/container-build.sh --test

Build image and run Level 1 regression suite:

./scripts/container-build.sh --regression

Build image only:

./scripts/container-build.sh

Interactive shell inside the container:

container run --rm -it solvitaire-dev bash

By default the script forces a clean build on every run (to avoid stale-cache issues with container CLI v0.9). Pass --use-cache to reuse the apt install layer when on a slow network.


Usage

List supported game types:

./cmake-build-release/bin/solvitaire --available-game-types

Solve a random Klondike deal (seed 42):

./cmake-build-release/bin/solvitaire --type klondike --random 42

Solve from a JSON deal file:

./cmake-build-release/bin/solvitaire --type free-cell path/to/deal.json

Key options: --type, --random <seed>, --json, --timeout <ms>, --cache-capacity <n>, --streamliners {none|auto-foundations|suit-symmetry|both|smart}, --solvability <N>.


Help

If you have any problems, please open an issue on GitHub.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Charlie Blake

💻 🎨 🤔

Ian Gent

💻 🎨 🤔

Shlomi Fish

💻

Gal Cohensius

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Potential improvements for Solvitaire, a patience/solvitaire solving program

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Makefile 89.4%
  • C++ 7.2%
  • CMake 1.7%
  • Python 0.8%
  • C 0.5%
  • Shell 0.3%
  • Other 0.1%