This is a solver for the Mastermind board game which finds guesses that minimize the maximum number of possibilities that remain after receiving the corresponding hint
It is implemented using the new std::simd SIMD Abstraction from Rust to target NEON, SSE2, AVX2 and WebAssembly SIMD from a shared implementation
Additionally, it uses rayon to enable multithreading
It finds optimal worst-case guesses 1 from all non-equivalent 2 guesses that minimize the maximum number of remaining possibilities
The core solver is implemented in libmastermind alongside a CLI-Solver and a Web frontend
https://0xbe7a.github.io/mastermind/
NOTE: No fallback for browsers without WASM and WebAssembly SIMD has been provided (Not Safari and Firefox is currently flaky)
- Run
nix develop
on Nix (or)- install rust-nightly with the
wasm32-unknown-unknown
target andrust-src
component - install wasm-pack
- install npm
- target the native CPU Features using
export RUSTFLAGS="-C target-cpu=native"
- install rust-nightly with the
- To build the CLI-Solver use
cargo build --release
- To build the WebApp
- Go to "web/www"
- use
npm install
- build the application with
npm run build