Initializes a life-like cellular automata
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
Options to pass for initialization
|
Classes
Methods
-
live (generations)state generator
-
Takes the game forward by n generations. If still life is reached globally, it stops living more generations.
Name Type Default Description generations
number Infinity Number of generations to live
-
Helper method to print the game on every generation
Name Type Description play
IterableIterator Return value of
live
methodoptions
object optional Name Type Default Description alive
* ⬛️ Symbol to represent alive cells
dead
* ⬜️ Symbol to represent dead cells
timePerGeneration
number 1 Time in seconds before next generation is rendered
-
Resets the game to initial state
-
skip (generations)state
-
Skips n generations ahead
Name Type Description generations
number Generations to skip
Returns:
Type Description state The state after skipping