Last chance! 50% off unlimited learning
Sale ends in
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.
corona_life(
pattern = "soup",
side = 50,
steps = 100,
density = 0.3,
filename = NULL,
wrap = TRUE,
fps = 20,
pause = 10
)
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
The number of elements on the area's side (width or height)
The number of frames
0.0--1 The density of the initial, random items ('soup')
writes to this file name e.g. foo.gif (NULL for current GIF device)
Wrap around
Frames per second
Initial pause
# 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)
# }
Run the code above in your browser using DataLab