Skip to content

This program solves arbitrary pentomino puzzle games with a sophisticated backtracking algorithm. Especially designed for Lonpos 66 puzzle.

License

Notifications You must be signed in to change notification settings

maik-s/PentominoLonposSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pentomino / Lonpos 2D Solver

This is one of my legacy projects from 2015, which is now brought back to life.

This programm implements a backtracking algorithm approach, in order to find all possible solutions for a pentomino / Lonpos puzzle game efficiently.

E.g. for the Lonpos 66 puzzle it finds 21,200 different solutions, as documented in the game's description.
Different serializers make it possible to save the solutions, e.g. as .png or .svg files.

Despite of the already implemented / configured game boards and puzzle pieces, one can add others, too.

To do that, you need to add new Stones in src/main/java/Stones and initialize them in main().

Examples

For an empty Lonpos 66 board all 21,200 solutions are found in short time.

Serialized svg image of the Lonpos 66 board:

Empty Lonpos 66 board

The following examples show two different solutions:

Lonpos 66 board solution

Lonpos 66 board solution

You find all 21,200 solutions in res/svg_solutions/

Build and Usage

This code was developed and tested on Fedora and Ubuntu. The latest test happend on Ubuntu 20.04 with Maven 3.6.3 and OpenJDK 11. Just run apt install maven and run mvn package within this repo.
The resulting target/PentominoLonposSolver-1.0-SNAPSHOT.jar is executable by running java -jar target/PentominoLonposSolver-1.0-SNAPSHOT.jar. It does not output something to the console, but will create a directory in /tmp/, in order to store the solution images.

Custom boards and stone placements

You can create custom Boards as new classes in src/java/Boards. Further, you occupy the fields as you wish and select which stones should be used for solving, by editing the code in `public static void main(String[] args)``

About

This program solves arbitrary pentomino puzzle games with a sophisticated backtracking algorithm. Especially designed for Lonpos 66 puzzle.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages