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

Jump to navigation Jump to search
m (Examples category)
(3 intermediate revisions by one other user not shown)
Line 59: Line 59:
=== Visualising it ===
=== Visualising it ===


To make the pattern easier to see, we can use [[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:
<source lang=apl>
<source lang=apl>
       Show←{'·⌺'[⎕IO+⍵]}
       Show←{'·⌺'[⎕IO+⍵]}
Line 279: Line 279:
       grid ← glider⍢(¯3 ¯3∘↑) 10 10⍴0  ⍝ This works
       grid ← glider⍢(¯3 ¯3∘↑) 10 10⍴0  ⍝ This works
</source>
</source>
=== Ruby ===
Github user zverok has translated Scholes' dfn to [[wikipedia:Ruby (programming language)|Ruby]] by first creating an <source lang=ruby inline>apl</source> module to implement parts of APL. The code is shown [https://github.com/zverok/ruby_as_apl on Github] and explained [https://zverok.github.io/blog/2020-05-16-ruby-as-apl.html on zverok's blog].


== Performance ==
== Performance ==
Line 307: Line 311:
== References ==
== References ==
<references />
<references />
[[Category:Examples]]
[[Category:Examples]][[Category:Dyalog APL examples]]
trusted
183

edits

Navigation menu