Skip to content

Instantly share code, notes, and snippets.

@coreyhaines
Created August 15, 2012 03:45
Show Gist options
  • Save coreyhaines/3355541 to your computer and use it in GitHub Desktop.
Save coreyhaines/3355541 to your computer and use it in GitHub Desktop.
100 x 100 Game of Life Kata
Write a system that evolves a 100 x 100 grid of cells
to the next generation according to the following rules.
1) Any living cell with less than 2 live neighbors dies
2) Any living cell with 2 or 3 live neighbors stays alive
3) Any living cell with more than 3 live neighbors dies
4) Any dead cell with exactly 3 lives neighbors comes to life
Note: A cell has 8 neighbors
...
.X.
...
1) No method may have more than 3 lines of code
2) No primitives (strings, integers, booleans, etc) or
primitive data structures (array, set, list, enumerable)
can be passed ACROSS (in or out) a method boundary.
That is, parameters and return values may ONLY be of types that you create.
Constructors are allowed to have primitive arguments.
No function may return anything except self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment