sum_living_neighbours: sum_living_neighbours

Description Usage Arguments Value Author(s)

View source: R/sum_living_neighbours.R

Description

Returns a matrix containing the number of living neighbours for each cell on the board.

Usage

1
sum_living_neighbours(board, torify = TRUE)

Arguments

board

An n^2 binary matrix with living cells indicated by 1s.

torify

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

Value

An n^2 matrix containing the number of living neighbours that each cell has.

Author(s)

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


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