Skip to content

Simple recursive backtracking solver and visualizer for the puzzle game suguru.

Notifications You must be signed in to change notification settings

SebastianBitsch/suguru-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Suguru solver

Solver

This is a small no-dependency suguru-solver that solves a m x n suguru puzzle using a recursive backtracking algorithm.
An arbitrary board of size n x m can be fed to the algorithm using two 2-dimensional lists, representing the board and the grouping. See sample_board.py for an example. The game can be played at puzzlemadness. The site also has an archive of hundreds of suguru puzzles which can be exported to this solver.

The game

Surugu is a puzzle game much like sudoku. The game is played on a grid split up in to irregular shaped regions. The number of cells in each region will vary from one cell, up to six cells for the bigger puzzles.

The aim of Suguru is to fill each n-sized region with the numbers 1-n. For example, if a region has 3 cells, you need to insert the numbers 1, 2 and 3 in to those cells. If a region has 4 cells, you need to insert the numbers 1, 2, 3, and 4 in to those cells.

Each number can't be next to the same number in an adjacent cell, this includes horizontally, vertically, and diagonally.

Animation

Animation of the algorithm solving a 6 x 6 suguru puzzle, the animation is created with matplotlib.
Areas of different colors represent regions that must include unique numbers as described above.

suguru-kopi

About

Simple recursive backtracking solver and visualizer for the puzzle game suguru.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages