Skip to content

Instantly share code, notes, and snippets.

@nsmaciej
Last active January 27, 2016 14:35
Show Gist options
  • Save nsmaciej/02a9f5c5b74c170ac75e to your computer and use it in GitHub Desktop.
Save nsmaciej/02a9f5c5b74c170ac75e to your computer and use it in GitHub Desktop.
Conway's game of life in Kona

Conway's game of life

Get Kona from http://kona.github.io and run with ./k cs

  • c.k - Neat version (192 characters)
  • cs.k - Tweet sized version (112 characters)
D:24 80
T:1 2 3 4 7
R:{x,(D[1]-3)#0}'(3 3#{|/T=x}'!9),((D[0]-3),3)#0
l:{|/(1;x)&3 4=\:+/,/2{-1 0 1!'\:x}/x}
d:{`0:{x,"|"}'{x,,(#*x)#"-"}" #"[a:l x];a}
{x;1}{+/!_1E7;`0:"\033[2J\033[;H";d x}/R
{x;1}{+/!_1E7;`0:"\033[2J\033[;H"," #"[a:|/(1;x)&3 4=\:+/,/2{-1 0 1!'\:x}/x];a}/|/(1 2 80 81 161=\:24 80#!1920)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment