package knights_tour
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=770624ae4e35d5a58188a1f25e16730d186df8bc4397827fe9a798ea5ca574e3
sha512=b6c7b2473ddf321afaac6b668f9c6820fb8cc872abc494b69edfdff4101c6b660645837b04801e2917c38dd9f19f79bb0a7b029d59a58ddf1e3a235659bab099
doc/knights_tour.pentominos/Pentominos/PointSet/index.html
Module Pentominos.PointSet
Source
include sig ... end
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
.
variants_with_transform shape
returns a list of (transform, variant)
pairs representing all variants of a given pointset. A variant is a shape obtained by applying rotation and mirroring transformations, followed by normalize_translation
. The transform
paired with each variant is a function t -> t
that applies a symmetry operation to the input pointset and produces the corresponding variant when applied to the input.
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