Ejemplo n.º 1
0
def test_cell_with_four_neighbors_dies():
    cell = (4,5)
    crowded_world = set([cell, (3,5), (4,4), (5,5), (3,4)])
    assert g.cell_survives(crowded_world, cell) is False
Ejemplo n.º 2
0
def test_cell_with_three_neighbors_survives():
    cell = (4,5)
    comfortable_world = set([cell, (3,5), (4,4), (5,5)])
    assert g.cell_survives(comfortable_world, cell) is True
Ejemplo n.º 3
0
def test_cell_with_no_neighbors_dies():
    cell = (4,5)
    lonely_world = set([cell])
    assert g.cell_survives(lonely_world, cell) is False