John Scholes' Conway's Game of Life: Difference between revisions

Jump to navigation Jump to search
Added references to Index Origin
(Added references to Index Origin)
(One intermediate revision by one other user not shown)
Line 12: Line 12:


The code here is written for [[Dyalog APL]]. It also works in [[ngn/apl]], and other [[Nested array theory|nested]] array languages allow similar implementations: see [[#Translations]].
The code here is written for [[Dyalog APL]]. It also works in [[ngn/apl]], and other [[Nested array theory|nested]] array languages allow similar implementations: see [[#Translations]].
In 2021, Conor Hoekstra remade the video with additional explanations.<ref>Hoekstra, Conor. [https://www.youtube.com/watch?v=pMslgySQ8nc APL + Game of Life = ❤️] in the [https://www.youtube.com/channel/UC1kBxkk2bcG78YBX7LMl9pQ code_report YouTube channel]. 2021-04-25.</ref>


== The Glider ==
== The Glider ==
Line 59: Line 61:
=== Visualising it ===
=== Visualising it ===


To make the pattern easier to see, we can use [[Bracket indexing|indexing]] to place a <source lang=apl inline>⌺</source> symbol where there's a cell and a <source lang=apl inline>·</source> otherwise, for example:
To make the pattern easier to see, we can use [[Bracket indexing|indexing]] to place a <source lang=apl inline>⌺</source> symbol where there's a cell and a <source lang=apl inline>·</source> otherwise, for example (note that <source lang=apl inline>⎕IO</source> is [[Index Origin]]):
<source lang=apl>
<source lang=apl>
       Show←{'·⌺'[⎕IO+⍵]}
       Show←{'·⌺'[⎕IO+⍵]}
24

edits

Navigation menu