Visualization of the recursive search algorithm used to solve the Bermuda Triangle Puzzle.
This is the short version of the following video: [ Ссылка ]
The short version skips unnecessary rotations and only shows valid placements (matching colors).
The Bermuda Triangle Puzzle is a wooden puzzle consisting of 1 big triangle and 16 smaller triangles of equal size. The goal of the puzzle is to arrange the triangles in a way so that each adjacent color is the same: red next to red, blue next to blue, and so on....
The animation was generated with the p5.js Javascript library, running in a Jupyter Notebook:
- The recursive algorithm is written in Python and runs in an IPython kernel
- The rendering runs in the web browser using the %%javascript cell magic
Source code with explanations:
[ Ссылка ]
![](https://s2.save4k.ru/pic/lW7mo-9TqEQ/mqdefault.jpg)