Solver for a wooden cube puzzle
  • OCaml 93.5%
  • Shell 3.4%
  • Dune 2.1%
  • Makefile 0.7%
  • Text 0.3%
Find a file
2026-09-08 12:29:46 +02:00
.github/workflows Build release artifacts with 5.5 2026-09-08 12:29:46 +02:00
.vscode Add spell check exceptions 2025-08-26 16:17:13 +02:00
images added images and README 2022-05-08 12:09:17 +02:00
src Add coverage annotation for post-installed path 2026-03-24 13:02:31 +01:00
test Update dunolint config 2025-12-12 10:50:48 +01:00
.gitattributes added gitattributes 2023-03-03 18:57:44 +01:00
.gitignore Reduce project dependencies 2025-12-01 16:39:00 +01:00
.headache.config Add headache config 2025-09-12 10:52:36 +02:00
.ocamlformat Upgrade ocamlformat to 0.29.0 2026-03-24 09:09:24 +01:00
CHANGES.md Edit changelog 2026-03-24 11:32:53 +01:00
CODE_OF_CONDUCT.md Adopt OCaml CODE 2025-09-12 10:53:15 +02:00
CODEOWNERS Initiate codeowners file for gh 2025-12-25 19:29:06 +01:00
COPYING.HEADER Add headache config 2025-09-12 10:52:36 +02:00
cubzzle-dev.opam Upgrade ocamlformat to 0.29.0 2026-03-24 09:09:24 +01:00
cubzzle-tests.opam Revert to ppx_expect (CI issues) 2025-12-02 22:40:10 +01:00
cubzzle.opam Use build-info for --version 2026-03-24 10:55:06 +01:00
dune fmt 2022-05-08 11:12:57 +02:00
dune-project Use build-info for --version 2026-03-24 10:55:06 +01:00
dune-workspace.5.2 Upgrade CIs 2026-04-12 13:20:10 +02:00
dune-workspace.5.3 Upgrade CIs 2026-04-12 13:20:10 +02:00
dune-workspace.5.4 Upgrade CIs 2026-04-12 13:20:10 +02:00
dune-workspace.5.5 Upgrade OCaml to latest available versions 2026-09-08 09:30:13 +02:00
dunolint Update dunolint config 2025-12-12 10:50:48 +01:00
headache.sh Remove left-over unused var (shellcheck) 2026-03-17 11:48:54 +01:00
LICENSE Add headache config 2025-09-12 10:52:36 +02:00
Makefile Upgrade to cmdlang.0.0.4 2024-09-07 15:56:21 +02:00
README.md Fix mention of cli option (2 dashes) 2025-08-26 16:21:52 +02:00

cubzzle

CI Status Coverage Status

This is a toy project implementing a brute force solver for a small wooden puzzle that I use to have at home.

What's the puzzle ?

There are 6 wooden pieces made of small cubes that can fit into a 3x3x3 box.

The puzzle

What does the solver do ?

The solver finds a solution and displays it in a Graphics window.

The cube

So that one can see exactly how the pieces fit, the display allows for inspecting pieces individually.

The cube help

Other shapes

You can assemble the same pieces into other shapes as well, such as a Dog:

The dog

or a Tower, etc.

The tower

Install

Releases for this project are published to a custom opam-repo. To add it to your current opam switch, run:

opam repo add mbarbin https://github.com/mbarbin/opam-repository.git

Then you can install cubzzle using a normal opam workflow.

opam install cubzzle

Running the code

The following command will open an OCaml Graphics window and run the solver:

$ cubzzle run

A few shapes are available (Cube, Dog, Tower, etc.). To solve a different shape, provide the option --shape. You can also draw the box during the brute force search, to see the solver run through all permutations interactively.

$ cubzzle run --shape=Tower --draw-box-during-search=true

Motivations

I wanted to have a small code sample using OCaml Graphics on GitHub.

Code Documentation

The code documentation of the latest release is built with odoc and published to GitHub pages here.