📊 Build status for all bb4 projects
A Scala puzzle framework with generators and solvers for classic puzzles — Sudoku, Hi-Q (peg solitaire), sliding tiles, Rubik’s Cube, Tantrix, mazes, and more. Each app shares a common search/UI framework so you can watch solvers find solutions or play by hand.
| Puzzle | Gradle task | Description |
|---|---|---|
| Hi-Q | runHiq |
Peg solitaire: jump until one peg remains in the center. |
| Sliding Puzzle | runSlidingpuzzle |
Slide numbered tiles into order. |
| Rubix Cube | runRubixcube |
Rotate cube layers until each face is a solid color (3D via jMonkeyEngine). |
| Sudoku | runSudoku |
Generate and solve Sudoku boards. |
| Tantrix | runTantrix |
Place hexagonal tiles so colored paths connect (3–30 pieces). |
| Amazing Maze | runMaze |
Generate mazes with tunable parameters. |
| One Tough Puzzle | runRedpuzzle |
Nine-piece all-nub jigsaw; brute-force and genetic solvers. |
| Bridge Crossing | runBridge |
Bridge-and-torch brain teaser: minimize crossing time. |
| Two Pails | runTwopails |
Measure a target volume by pouring between two containers. |
Option 1 — installer (recommended): download the installer for your OS from the
latest release
(macOS .dmg, Windows .msi, Linux .deb — one installer per puzzle).
Option 2 — from source:
git clone https://github.com/bb4/bb4-puzzles.git
cd bb4-puzzles
./gradlew runSudoku # or runHiq, runMaze, runTantrix, …
./gradlew tasks --group application # list all runnable puzzlesThe default ./gradlew run launches the maze generator. Gradle creates a run<Puzzle> task for each entry in appMap.
Published artifacts (latest release 2.1):
implementation 'com.barrybecker4:bb4-puzzle:2.1' // shared framework
implementation 'com.barrybecker4:bb4-sudoku:2.1'
implementation 'com.barrybecker4:bb4-hiq:2.1'
// also: bb4-slidingpuzzle, bb4-rubixcube, bb4-tantrix, bb4-maze,
// bb4-redpuzzle, bb4-bridge, bb4-twopailsSee the releases page if you need a different version.
com.barrybecker4.puzzle.common— shared framework: puzzle controllers, Swing viewers/renderers, and solvers (sequential, concurrent, A*, IDA*)- Per-puzzle packages under
com.barrybecker4.puzzle.*— model, UI, and solver code for each app in the table above com.barrybecker4.puzzle.rubixcube— 3D cube UI built on jMonkeyEngine / LWJGL
The Tantrix and Red Puzzle solvers that use bb4-optimization (genetic search, simulated annealing, global hill climbing, ...) can be benchmarked, and the timings are compared across bb4-optimization versions in docs/benchmarks.md.
./gradlew benchmark # run on the bb4-optimization version in build.gradle
./gradlew benchmark -PbenchmarkArgs="--reps=3 --timeout=30 --tantrix-sizes=3,6,9"
./gradlew benchmarkReport # regenerate docs/benchmarks.md from docs/benchmarks.jsonEach run is recorded in docs/benchmarks.json under the bb4-optimization version found on the classpath, so
changing the dependency version and running ./gradlew benchmark again adds a column to the report without
touching the existing numbers. Algorithms are discovered from each puzzle's Algorithm enum, so strategies that
are added to the enum later appear automatically (older versions show n/a). Pass --lib-version=2.0.0 to make
the run fail if a different version (or a local composite build of bb4-optimization) is actually on the classpath.
Each run executes in its own JVM that is killed if it exceeds the time limit, so a solver that gets stuck cannot
slow down the runs that follow it (--in-process disables this, but then a runaway solver cannot be stopped).
Timings are only comparable between runs on the same machine.
See the Building bb4 Projects wiki.
MIT — see LICENSE.



