Skip to content

Instantly share code, notes, and snippets.

@marick
Created June 11, 2010 19:44
Show Gist options
  • Save marick/434940 to your computer and use it in GitHub Desktop.
Save marick/434940 to your computer and use it in GitHub Desktop.
(know "rules that determine the life or death of a cell in the sucessor generation"
(successor ...cell...) =means=> (killed ...cell...)
(provided ; underpopulation
(living? ...cell...) => true
(living-neighbor-count ...cell...) =from=> [0, 1])
(or ; overpopulation
(living? ...cell...) => true
(living-neighbor-count ...cell...) =from=> [4 ,,, 8])
(or ; not enough cells to bring to life
(living? ...cell...) => false
(living-neighbor-count ...cell...) =from=> [0,,,2]) ;
(or ; too many cells to bring to life
(living? ...cell...) => false
(living-neighbor-count ...cell...) =from=> [4,,,8]) ;
(successor ...cell...) =means=> (vivified ...cell...)
(provided
(living? ...cell...) => true
(living-neighbor-count ...cell...) =from=> [2, 3])
(or
(living? ...cell...) => false
(living-neighbor-count ...cell...) => 3)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment