Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Created May 17, 2011 04:02
Show Gist options
  • Select an option

  • Save jashkenas/975930 to your computer and use it in GitHub Desktop.

Select an option

Save jashkenas/975930 to your computer and use it in GitHub Desktop.
for i in [-1..1]
for j in [-1..1]
if @isAlive cell.row + i, cell.col + j
neighbors++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment