Skip to content

Repository files navigation

bb4-puzzles

CI

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.

Screenshots

Sudoku

Hi-Q

Maze

Tantrix

Puzzles

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.

Running it

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 puzzles

The default ./gradlew run launches the maze generator. Gradle creates a run<Puzzle> task for each entry in appMap.

Using it as a library

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-twopails

See the releases page if you need a different version.

What's inside

  • 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

Building from source

See the Building bb4 Projects wiki.

License

MIT — see LICENSE.

About

A Scala puzzle framework with generator and solver implementations for puzzles like Sudoku, Hi-Q, OneTough Puzzle, Tantrix, and others.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages