

2-state non-isotropic cellular automata (for range-1 Moore, hexagonal and von Neumann).2-state isotropic non-totalistic cellular automata (for range-1 Moore and range-1 hexagonal).2-state outer-totalistic Life-like cellular automata (from ranges 1 to 500, supporting a wide variety of pre-programmed neighbourhood families, as well as custom neighbourhoods and weighted neighbourhoods).LifeViewer supports the following rule families: Editor with unlimitied undo/redo and multiple clipboards.Automatic scaling for high DPI displays including smartphones and tablets.Identification of still life patterns, oscillator and spaceship periods.Ability to build patterns from RLE recipes with transformations.Programatically pasting cells onto the grid at defined intervals (for example: glider injection).Pattern annotation with Labels, Arrows, Lines and Polygons.Real time auto-scaling population graph.Ability to step back to earlier generations for all patterns and reverse playback for reversible Margolus and PCA patterns.Support for multiple embedded LifeViewers and/or a single popup LifeViewer.Script language that allows many features to be customized including Waypoint animations.Multiple ways to automatically track patterns with the camera as they evolve.Square, hexagonal and triangular grids.Colour themes with cell history and longevity.Smooth non-integer zoom with anti-aliasing and rotation.Some ideas include: use lots of colors for drawing, save a drawing to a file, reload a drawing from a file as a staring point. I love to see what improvements the clever folks in the Xojo community can do. If Cells(x, y) = True And (neighborCount = 2 Or neighborCount = 3) ThenĮlseIf Cells(x, y) = False And neighborCount = 3 ThenĪlthough this is a desktop project, it should be easily adaptable to other targets. Var neighborCount As Integer = CountNeighbors(x, y) Start with a new blank cell grid and apply rules to itįor x As Integer = 0 To Cells.LastIndex(1)įor y As Integer = 0 To Cells.LastIndex(2) All other live cells die In the Next generation. Any dead cell With three live neighbours becomes a live cell. Any live cell With two Or three live neighbours survives. Loop through all the cells and apply these rules. The primary method is called Life() and looks like this: Public Sub Life() The Xojo project tracks the cells in a two-dimensional array and applies the rules to the array, creating a new array that is then drawn in a Canvas. There are several sample patterns on the Game of Life Wikipedia page. To use Life, draw a pattern in the grid using the mouse. Here is how the pattern “The R-pentomino” looks: You start a game of life with your seed pattern and then see how it progress through multiple generations. Similarly, all other dead cells stay dead.

All other live cells die in the next generation.Any dead cell with three live neighbors becomes a live cell.Any live cell with two or three live neighbors survives.The cells can turn from alive (on) to dead (off) depending on some simple rules: The way it works is that you have a grid of cells. You’ve probably seen this around in some form or another, but I ran across it again recently and thought it would be fun to implement in Xojo. The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.
