Solving a 25-Piece Wooden Puzzle with Haskell: Part I

2025-09-20

The author received a challenging 3D puzzle consisting of 25 identical wooden pieces and, after struggling to solve it manually, decided to leverage the power of the Haskell programming language. This is the first of a two-part series focusing on modeling the problem. The author models the space as a 3D grid, using vectors to represent positions and defining data structures for a single piece and its arrangement in space. The article details how linear algebra and Haskell features are used to represent rotations and translations of the pieces, generating a candidate list of all possible arrangements. The article ends with a cliffhanger, leaving the solution of finding the correct arrangement from the candidates to the second part.

Development 3D Puzzle