Skip to content

Instantly share code, notes, and snippets.

@abyx
Created November 4, 2010 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abyx/662849 to your computer and use it in GitHub Desktop.
Save abyx/662849 to your computer and use it in GitHub Desktop.
Game of Life snippet #1
if cell.is_alive? and cell.neighbours in (2,3) then
cell.stay_alive
elsif cell.is_dead? and cell.neighbours == 2 then
cell.live!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment