Documentation for class Lifetree.
Any function not shown here is only used by other functions.

class Pattern(builtins.object)
 |  Pattern(lifetree, grid={})
 |
 |  This is the class used for manipulation of patterns.
 |
 |  Methods defined here:
 |
 |  __add__(self, other)
 |      Returns the OR of two patterns.
 |      e.g pt + pt2 will return the OR of pt and pt2.
 |
 |  __call__(self, *args)
 |      Translates or transforms a pattern.
 |      e.g pt(10, 6) will translate a pattern 10 cells right and 6 cells down.
 |
 |  __getitem__(self, gens)
 |      Advances a pattern a given number of generations.
 |
 |  __init__(self, lifetree, grid={})
 |      This method should only be called by a Lifetree.
 |
 |  __ixor__(self, other)
 |      Returns the XOR of two patterns.
 |      e.g pt ^ pt2 will return the XOR of pt and pt2.
 |
 |  __or__(self, other)
 |      Returns the OR of two patterns.
 |      e.g pt + pt2 will return the OR of pt and pt2.
 |
 |  __sub__(self, other)
 |      Removes live cells in one pattern from the other.
 |      e.g pt - pt2 will return pt, but with all cells from pt2 removed.
 |
 |  __xor__(self, other)
 |      Returns the XOR of two patterns.
 |      e.g pt ^ pt2 will return the XOR of pt and pt2.
 |
 |  clone(self)
 |      Creates a copy of a pattern.
 |
 |  centre(self)
 |      Moves a pattern so that the bounding box is centered on the origin.
 |  move(self, dx, dy)
 |      Translates a pattern by (dx, dy).
 |      e.g pt(10, 6) will translate a pattern 10 cells right and 6 cells down.
 |
 |  oscar(self, maxgens=1024)
 |      Finds the period of a pattern. Returns an error if it is aperiodic.
 |
 |  save(self, filename='pattern.rle'
 |      Saves a pattern's RLE as a file.
 |      Will overwrite existing files, and requires access to the given file.
 |
 |  transform(self, transformation)
 |      Transforms a pattern relative to the origin.
 |      e.g pt('rcw') returns pt rotated clockwise around the origin.
 |      Supported transformations are: identity rot_90 rot_180 rot_270 flip_x flip_y flip_xy rcw rccw
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties defined here:
 |
 |  apgcode
 |      A unique identifier for periodic patterns.
 |      Read more here: https://conwaylife.com/wiki/Apgcode
 |      Will return an error if aperiodic.
 |
 |  bbox
 |      The bounding box of a pattern in the form [x, y, dx, dy].
 |      Returns None if pattern is empty.
 |
 |  components
 |      A list of the connected islands in a pattern.
 |      All the cells in each island are orthogonally or diagonally adjacent to at least one other cell in the island.
 |
 |  coords
 |      A list of every cell in a pattern.
 |      e.g [(0, 0), (0, 1), (2, 0)]
 |
 |  digest
 |      A hash of the pattern (orientation dependent).
 |      Useful for comparing patterns.
 |
 |  displacement
 |      The displacement of a periodic pattern in the form (dx, dy). Returns an error if aperiodic.
 |
 |  firstcell
 |      The first cell of a pattern.
 |
 |  octodigest
 |      A hash of the pattern (orientation independent).
 |      Useful for comparing patterns.
 |
 |  period
 |      The period of a pattern. Returns an error if aperiodic.
 |      Current maximum period is 1024, but this may be increased once faster algorithms are implemented.
 |
 |  population
 |      How many live cells a pattern has.
 |
 |  rle
 |      The Run Length Encoding (RLE) of a pattern.
 |      This is a simple form of lossless compression, commonly used to store and transmit patterns as text.
 |      Read more here: https://conwaylife.com/wiki/Run_Length_Encoded

