Logo: Relish

  1. Sign in

Project: Bdd-kata-conways-life

Evolving a dead cell

A dead cell should follow the rules of the game
when evolving from one generation to the next.

Scenarios
A dead cell with 0 neighbors stays dead
Given
I have supplied the following generation
. . .
. . .
. . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 1 neighbor stays dead
Given
I have supplied the following generation
. x .
. . .
. . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 2 neighbors stays dead
Given
I have supplied the following generation
. x .
. . x
. . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 3 neighbors comes to life
Given
I have supplied the following generation
x x x
. . .
. . .
When
I tell the world to evolve once
Then
the center cell should be alive
A dead cell with 4 neighbors stays dead
Given
I have supplied the following generation
x x x
. . x
. . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 5 neighbors stays dead
Given
I have supplied the following generation
x x x
x . x
. . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 6 neighbors stays dead
Given
I have supplied the following generation
x x x
x . x
x . .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 7 neighbors stays dead
Given
I have supplied the following generation
x x x
x . x
x x .
When
I tell the world to evolve once
Then
the center cell should be dead
A dead cell with 8 neighbors stays dead
Given
I have supplied the following generation
x x x
x . x
x x x
When
I tell the world to evolve once
Then
the center cell should be dead

Last published over 6 years ago by jcouball.