Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ae2e42
commit ddff87a
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Feature: Evolving a living cell | ||
In order to create a functioning rules engine | ||
As a programmer of Conway's Game of Life | ||
I can evolve a single living cell | ||
|
||
Scenario: Living cell with 0 neighbors dies | ||
Given the following setup | ||
| . | . | . | | ||
| . | x | . | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 1 neighbor dies | ||
Given the following setup | ||
| . | x | . | | ||
| . | x | . | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 2 neighbors lives | ||
Given the following setup | ||
| . | x | . | | ||
| . | x | x | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be alive | ||
|
||
Scenario: Living cell with 3 neighbors lives | ||
Given the following setup | ||
| x | x | x | | ||
| . | x | . | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be alive | ||
|
||
Scenario: Living cell with 4 neighbors dies | ||
Given the following setup | ||
| x | x | x | | ||
| . | x | x | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 5 neighbors dies | ||
Given the following setup | ||
| x | x | x | | ||
| x | x | x | | ||
| . | . | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 6 neighbors dies | ||
Given the following setup | ||
| x | x | x | | ||
| x | x | x | | ||
| x | . | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 7 neighbors dies | ||
Given the following setup | ||
| x | x | x | | ||
| x | x | x | | ||
| x | x | . | | ||
When I evolve the board | ||
Then the center cell should be dead | ||
|
||
Scenario: Living cell with 8 neighbors dies | ||
Given the following setup | ||
| x | x | x | | ||
| x | x | x | | ||
| x | x | x | | ||
When I evolve the board | ||
Then the center cell should be dead |