Jump to content

Conway's Game of Life: Difference between revisions

→‎APL: Added GNU APL version, John Scholes (ex. 2)
(→‎APL: Added GNU APL version, John Scholes (ex. 2))
Line 1,404:
 
=={{header|APL}}==
GNU APL
 
 
(from Wikipedia: https://aplwiki.com/wiki/John_Scholes%27_Conway%27s_Game_of_Life#Translations)<syntaxhighlight lang="apl">
Life←{↑↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
m ← 5 5⍴(0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0)
m
0 0 0 0 0
0 0 0 0 0
0 1 1 1 0
0 0 0 0 0
0 0 0 0 0
Life m
0 0 0 0 0
0 0 1 0 0
0 0 1 0 0
0 0 1 0 0
0 0 0 0 0
 
</syntaxhighlight>
 
 
[http://www.dyalog.com/dfnsdws/c_life.htm APL2 (Dyalog) Example in one line]
 
67

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.