package knights_tour
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8362f846492183e83e1901f73933d772c193c08b8a375480c28d0f23f0d29e11
sha512=5fe79ac95a3e5a2e01d429665fa7a8bfef422d9843758b35db2c8efc299c762c1d22974266f5e8802ee6f81e09223aa90476824d1fd93540c473cc8a357d38a3
doc/knights_tour.pentominos/Pentominos/PointSet/index.html
Module Pentominos.PointSet
Source
include sig ... end
Checks whether a set of points is 'coherent'. What this means is that every points in the set can be reached from every other point in the set via its neighbours. If we consider a pointset to represent a polyomino, then it means the pointset represents a single puzzle piece (rather two or more disconnected 'islands' of points).
Takes a 'string image' of a pointset and parses it. A string image is just a multiline string where each character indicates whether or not the square/point at the corresponding location is part of the set.
Leading and trailing whitespace on each line are ignored. The remaining characters are interpreted as follows:
.
means the corresponding square isb not
in the set- any other character means that it is.
Gets the set of adjacent points. A point is adjacent if it satisfies both:
- it is a 'neighbour of any one of the point in the input; and
- it is not a point in the input itself
Translates the pointset so that all points x
and y
coordinates are greater or equal to 0; and have the smallest possible values given these conditions (i.e there is at least one point with x = 0
, and one point (possibly a different one) with y = 0
))
Gets all 'variants' of a given PointSet. A variant is similar shape obtained by applying rotation and mirroring transformations; and then applying normalize_translation
.
Gets a canonical representation of a pointset that can be used to represent all variants.
Move all points an equal distance in both x and y coordinates