Created
August 15, 2012 03:45
-
-
Save coreyhaines/3355541 to your computer and use it in GitHub Desktop.
100 x 100 Game of Life Kata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
... | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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