Fork me on GitHub

miniGameOfLife

A HTML/JS Game of Life implementation in 238b
Golfed by xem, subzey and aemkei

Source:
Download

<body onkeyup="a=b;b=[h='<pre>'];for(i=40;i--;h+='\n')for(j=80;j
--;){k=80*i+j;d=0;for(z in e=[1,79,80,81])d+=a[k+e[z]]+a[k-e[z]]
;h+='<a onclick=innerHTML=q[b['+k+']^=1]>'+q[b[k]=3==d|a[k]&2==d
]}innerHTML=h"onload=f.onkeyup(b=q=".@") id=f>


Demo:

Click to toggle a cell - press any key to iterate




© Maxime Euzière - 2014