This is a toy project implementing a brute force solver for a small wooden puzzle that I use to have at home.
There are 6 wooden pieces made of small cubes that can fit into a 3x3x3 box.
The solver finds a solution and displays it in a Graphics window.
So that one can see exactly how the pieces fit, the display allows for inspecting pieces individually.
You can assemble the same pieces into other shapes as well, such as a Dog:
or a Tower, etc.
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
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
I wanted to have a small code sample using OCaml Graphics on GitHub.
The code documentation of the latest release is built with odoc
and published to GitHub
pages here.