Solves puzzles that require players to use some 4-tiled Tetris blocks to cover a rectangular grid.
At first this program is meant to help solving puzzles of the Steam game Sigils of Elohim.
While searching for inspiration and suitable algorithms, I happened to see this post , linking the problem to the so-called Exact-Covering Problem , and by using the smart Dancing Links data structure, great improvements are made out of plain brute-force enumeration.
For the usage of the program, simply input the 9 needed data for the puzzle, including the row and column of the board, and numbers of each type (there’re 7 of them) of 4-tiled Tetris.
For the following puzzle (A-Red-8) :
Program input:
You can see the searching procedure as the program recursively dance the links and prints the current candidate rows (from the solution space matrix). However, due to the nature of the algorithm, only one fixed result is generated, and turtle will paint something like this :
Great job done!