package knights_tour
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8362f846492183e83e1901f73933d772c193c08b8a375480c28d0f23f0d29e11
sha512=5fe79ac95a3e5a2e01d429665fa7a8bfef422d9843758b35db2c8efc299c762c1d22974266f5e8802ee6f81e09223aa90476824d1fd93540c473cc8a357d38a3
doc/knights_tour.pentominos/Pentominos/Polyomino/index.html
Module Pentominos.Polyomino
Source
A Polyomino is a puzzle piece composed of a number equally sized grid-squares. Depending on the number of squares they can go by different names.
- 5 squares: 5-omino or pentomino
- 2 squares: 2-omino or domino
We represent polyominos as a Set of points with an x
and y
coordinate.
Typically puzzles and games involving polyominos have physical puzzle pieces that can be flipped over and rotated. The pieces can also be placed down on the puzzle board at different locations.
This means that to decide whether two sets of points represent the same Polyomino puzzle piece, we need to consider them equivalent under these transformations:
- rotate 90, 180 or 270 degrees
- flipped around (mirroring along the vertical or horizontal axis)
- translated
An unplaced polyomino puzzle piece. It is characterized by a normalized PointSet, making it invariant to any combination 90 degree rotation, mirroring, and translation.
Gets the 'name' of a polyomino. The name is unique for polyomino of a the same order (i.e. if two polyominos have the same order and the same name, it means they are the same polyomino)
Compares two polymoninos to see if they represent the same shape; invariant to rotation, mirroring and translation
Gets the canonical PointSet that characterizes this Polyomino
Gets all variants of a given Polyomino. A variant is simlar shape obtained by applying rotation and mirroring transformations (but no translation). I.e. it is a specific orientation of Polyomino that has not yet been placed on a specific location of the board.
Print string image of polyomino to a formatter