Free polyominoes enumeration: Difference between revisions

Content added Content deleted
(julia example)
Line 1,386: Line 1,386:


canonical(poly) = polysort!(map(translate_to_origin, rotations_and_reflections(poly)))
canonical(poly) = polysort!(map(translate_to_origin, rotations_and_reflections(poly)))

in_asstring(elem, vec) = begin s = string(elem); any(x -> x == s, map(string, vec)) end


contiguous(p) = [Point(p.x - 1, p.y), Point(p.x + 1, p.y),
contiguous(p) = [Point(p.x - 1, p.y), Point(p.x + 1, p.y),
Line 1,472: Line 1,470:
#####
#####
</pre>
</pre>




=={{header|Kotlin}}==
=={{header|Kotlin}}==