Exemplo n.º 1
0
def test_dead_cell_three_neighbours_realive():
    assert game_of_life.dead_or_alive([[0, 1, 0], [0, 1, 0], [0, 1, 0]], (1),
                                      (0)) == 1
Exemplo n.º 2
0
def test_dead_cell_more_than_three_neighbours_remains_dead():
    assert game_of_life.dead_or_alive([[1, 1, 0], [0, 1, 0], [1, 1, 0]], (1),
                                      (0)) == 0
Exemplo n.º 3
0
def test_dead_cell_two_neighbours_remains_dead():
    assert game_of_life.dead_or_alive([[0, 1, 0], [0, 1, 0], [1, 1, 0]], (0),
                                      (0)) == 0
Exemplo n.º 4
0
def test_live_cell_more_than_three_neighbours_dies():
    assert game_of_life.dead_or_alive([[1, 1, 0], [1, 1, 0], [0, 1, 0]], (1),
                                      (1)) == 0
Exemplo n.º 5
0
def test_live_cell_two_neighbours_live():
    assert game_of_life.dead_or_alive([[1, 1, 0], [0, 1, 0], [0, 1, 0]], (0),
                                      (0)) == 1
Exemplo n.º 6
0
def test_live_cell_one_neighbours_dies():
    assert game_of_life.dead_or_alive([[1, 1, 0], [0, 0, 0], [0, 1, 0]], (0),
                                      (0)) == 0
Exemplo n.º 7
0
def test_live_cell_no_neighbours_dies():
    assert game_of_life.dead_or_alive([[0, 0, 0], [0, 0, 0], [0, 1, 0]], (2),
                                      (1)) == 0