This project implements a fast multithreaded solver for peg-solitaire, capable of calculating all solvable constellations in ~1s.
- Number of canonical paths to the solution (modulo symmetry)
- Number of remaining possible move multisets
- Success probability when doing random moves
- Total number of explored feasible constellations
Based on the calculated solution graph, an interactive solver is included, showing which moves lead to a solvable or unsolvable constellation.
This solver is available online as a WASM base WebApp and can be built for Desktop or Android (as of right now).
Install dependencies:
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli
sudo apt install binaryen brotliBuild:
makeTo build the Android App:
Install cargo-ndk:
cargo install --locked cargo-ndkInstall necessary toolchains:
rustup target add aarch64-linux-android
# optional (for x64 / 32-bit arm):
rustup target add x86_64-linux-android armv7-linux-androideabiCompile peg_solitaire.so native shared-library:
cargo ndk -t arm64-v8a -o app/src/main/jniLibs build --package solitaire-game --release
# optional (for x64 / 32-bit arm):
cargo ndk -t arm64-v8a -t x86_64 -t armeabi-v7a -o app/src/main/jniLibs build --package solitaire-game --releaseBuild the app:
./gradlew assemble
# apk will be at app/build/outputs/apk/release/app-release.apk