is a GUI application written in Go to solve shapes puzzles:
This project uses the provides bindings for the GTK+3. Follow the project's instructions at https://github.com/gotk3/gotk3/wiki#installation to install it.
After having satisfied the Gotk3 dependencies, you can compile the application with
go build
Once built, you can run the application with:
./shapes
The application takes two parameters:
- gui=[true|false] (defaults to true) if the application is to be run with a GUI or on the command line
- filename=filename (defaults to 'models/5x6.model')
This is the command to launch it on command line with the 4x4.model
:
./shapes -gui=false -filename=models/4x4.model
This repo contains some models of the puzzles. If you want to solve a new one, just create a new .model
file; the format is simply the disposition of the pieces where every piece is specified by a number (greater then 0) or a letter. So, the puzzle can have a maximum of 35 pieces (26 case unsensitive letter and 9 numbers).
The application uses a basic backtracking algorithm to find the solutions with some branch cutting for improving performances. There's a complete explanation of the internals here: https://medium.com/@andreaiacono/backtracking-explained-7450d6ef9e1a