Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Decades ago, I read an article in Byte magazine discussing various implementations of GoL. The article ended with an implementation in one line of APL. What are the chances you (or anyone) still has that article, and that one line program?


Heh -- "if you need more than one line of APL you do not fully understand your problem".

  https://news.ycombinator.com/item?id=1041500
People have done similar things in all kinds of languages by now:

  https://codegolf.stackexchange.com/questions/3434/shortest-game-of-life


This video constructs a GoL in APL (not one liner). It is quite understandable even if you don’t know APL (I had just started tinkering with APL when I first found it I think): https://m.youtube.com/watch?v=a9xAKttWgP4

In case somebody is curious to see how it might look like.


    life←{⊃1 ⍵ ∨ .∧ 3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}


and if you want some additional explanation:

https://aplwiki.com/wiki/Conway%27s_Game_of_Life




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: