corona_life {corona} | R Documentation |
Animate Conway's Game of Life
Description
The canvas (arena) wraps around vertically and horizontally! Execution will take some time. Results will be viewed differently depending on your system's default viewer for animated GIF files.
Usage
corona_life(
pattern = "soup",
side = 50,
steps = 100,
density = 0.3,
filename = NULL,
wrap = TRUE,
fps = 20,
pause = 10
)
Arguments
pattern |
Defaults to 'soup' but there are many other well-known options: blinker ttetromino rpentomino toad beehive beacon clock pulsar pentadecathlon galaxy spaceship glidergun piheptomino switchengine conway acorn rabbits boring static patterns: block snake eater |
side |
The number of elements on the area's side (width or height) |
steps |
The number of frames |
density |
0.0–1 The density of the initial, random items ('soup') |
filename |
writes to this file name e.g. foo.gif (NULL for current GIF device) |
wrap |
Wrap around |
fps |
Frames per second |
pause |
Initial pause |
Examples
## Not run:
corona_life( filename='animation.gif', side=50, steps=500, density=0.2 )
corona_life( side=100, steps=1000, pattern='rpentomino', wrap=FALSE )
corona_life( side=30, steps=120, pattern='spaceship' )
corona_life( side=100, steps=400, pattern='switchengine' )
corona_life( side=20, steps=30, pattern='clock' )
corona_life( side=20, steps=30, pattern='galaxy' )
corona_life( side=100, steps=200, pattern='glidergun' )
corona_life( side=45, steps=130, pattern='conway', fps=8, pause=40)
## End(Not run)
[Package corona version 0.3.0 Index]