Genius Square
Genius Square puzzle solver in Python
Introduction
The Genius Square is a spacial awareness game for children. The game consists of seven, six-sided dice, a 6x6
board, 7 'blocker' pieces, and 9 tetris-like pieces of different shapes.
A player rolls seven six-sided dice:
Each dice is then used to put a 'blocker' piece on the board at the given location:
The player then takes the 9 coloured pieces and attempts to fit them onto the board:
One completed state for the board would be as follows:
Algorithm
To solve the puzzle we take one of the largest pieces, in our case the four-cell-square piece and attempt to find a place on the board where it fits in. Once we have done so, we then check the next smallest piece and attempt to find a place where that also fits. At some point we will reach a situation where there are no locations where the current piece can go. At this point we back-track to the previous pieces and see if there are additional locations that can be used. This is continued until we reach the smallest piece, which should fit in the large remaining cell.
Usage
Simply click ROLL DICE to set the seven blocker cells. Then click SOLVE to solve the puzzle.
Setup
For Python we need the following:
pygame (Tested with v1.9.6)
numpy (Tested with v1.18.3)
pip install pygame
pip install numpy