Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Forked from coreyhaines/gol_rules.rb
Created November 7, 2010 18:22
Show Gist options
  • Select an option

  • Save jasongorman/666298 to your computer and use it in GitHub Desktop.

Select an option

Save jasongorman/666298 to your computer and use it in GitHub Desktop.
def tick(cell, number_of_neighbors)
if number_of_neighbors < 2 || number_of_neighbors > 3
cell.setAlive false
end
if number_of_neighbors == 3
cell.setAlive true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment