An implementation of Conway's Game of Life in less than 140 bytes of JavaScript.
See the demo: http://jsfiddle.net/aemkei/wdRcc/show/
life (
input, // input array
size // size (width and height) of stage
)
// returns the modificated input string
Created by Martin Kleppe (@aemkei) at Ubilabs.
See the 140byt.es site for a showcase of entries (built itself using 140-byte entries!), and follow @140bytes on Twitter.
I came here because of this. With a simple change this allows non-square stages.
a
is the input array,b
is the width of the stage.I also thought about wrapping but I don't think there is an easy solution. Would need a lot of
%
and||0
.