game_of_life: game_of_life

Description Usage Arguments Value Author(s)

View source: R/game_of_life.R

Description

Run John Conway's cellular automata Game of Life.

Usage

1
game_of_life(seed, num_gens, board_size = 50, animate = TRUE, torify = TRUE)

Arguments

seed

An nx2 matrix containing the co-ordinates of n seeds for the game.

num_gens

An integer specifying the number of generations of evolution in the game.

board_size

An integer specifying the size of the 2D array. Defaults to 50.

animate

Logical indicating whether to animate the game (defaults to TRUE).

torify

Logical indicating whether the board should be wrapped up into a torus to prevent inconsistencies at the edges (defaults to TRUE).

Value

An object of class gameRlife. Can be used for the side-effect of animating the cellular automata as they evolve.

Author(s)

Alex Kalinka, alex.t.kalinka@gmail.com


alextkalinka/gameRlife documentation built on Jan. 4, 2022, 12:02 a.m.