Conway's Game of Life: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Mention Stencil)
No edit summary
Line 1: Line 1:
'''[[wikipedia:Conway's Game of Life|Conway's Game of Life]]''' is a well-known cellular automaton in which each generation of a population "evolves" from the previous one according to a set of predefined rules. The Game of Life is defined on an infinite [[Boolean]] grid, but usually only finite patterns, where all 1 values fit in a finite Boolean [[matrix]], are studied. Because it involves interactions between adjacent [[elements]] of the matrix, and can take advantage of APL's convenient and fast Boolean handling, implementing the Game of Life is a popular activity for APLers. Published APL implementations have appeared since 1971, a year after the rules of the Game of Life were first published. More recently, it is sometimes seen as a use case for the [[Stencil]] operator, which provides a concise way to work on three-by-three neighborhoods as used by the Game of Life.
'''[[wikipedia:Conway's Game of Life|Conway's Game of Life]]''' is a well-known cellular automaton in which each generation of a population "evolves" from the previous one according to a set of predefined rules. The Game of Life is defined on an infinite [[Boolean]] grid, but usually only finite patterns, where all 1 values fit in a finite Boolean [[matrix]], are studied. Because it involves interactions between adjacent [[elements]] of the matrix, and can take advantage of APL's convenient and fast Boolean handling, implementing the Game of Life is a popular activity for APLers. APL implementations have appeared in the [[APL Quote-Quad]] since 1971, a year after the rules of the Game of Life were first published. More recently, it is sometimes seen as a use case for the [[Stencil]] operator, which provides a concise way to work on three-by-three neighborhoods as used by the Game of Life.


A famous video by [[John Scholes]]<ref name="scholes">[[John Scholes|Scholes, John]]. [https://www.youtube.com/watch?v=a9xAKttWgP4 "Conway's Game of Life in APL"]. 2009-01-26.</ref> explains the following [[Dyalog APL]] implementation step by step. The implementation takes advantage of [[nested]] arrays and the [[Outer Product]] to produce many copies of the argument array. It finds adjacent elements by [[Rotate|rotating]] the original array, causing elements at the edge to wrap around (giving a torus geometry).
A famous video by [[John Scholes]]<ref name="scholes">[[John Scholes|Scholes, John]]. [https://www.youtube.com/watch?v=a9xAKttWgP4 "Conway's Game of Life in APL"]. 2009-01-26.</ref> explains the following [[Dyalog APL]] implementation step by step. The implementation takes advantage of [[nested]] arrays and the [[Outer Product]] to produce many copies of the argument array. It finds adjacent elements by [[Rotate|rotating]] the original array, causing elements at the edge to wrap around (giving a torus geometry).

Navigation menu