Exemplo n.º 1
0
 def testNextToTwo(self):
     cells = game.create_cells(game.ROWS, game.COLUMNS)
     cells[0][1] = True
     cells[1][0] = True
     self.assertEqual(False, game.should_live(0, 0, cells), "Should stay dead")
     cells[0][0] = True
     self.assertEqual(True, game.should_live(0, 0, cells), "Should stay alive")
Exemplo n.º 2
0
 def testNextToMoreThanThree(self):
     cells = game.create_cells(game.ROWS, game.COLUMNS)
     cells[0][0] = True
     cells[0][1] = True
     cells[0][2] = True
     cells[1][0] = True
     self.assertEqual(False, game.should_live(1, 1, cells), "Should stay dead")
     cells[0][0] = True
     self.assertEqual(False, game.should_live(1, 1, cells), "Should die")
Exemplo n.º 3
0
 def testCellIsolated(self):
     cells = game.create_cells(game.ROWS, game.COLUMNS)
     self.assertEqual(False, game.should_live(0, 0, cells), "Should stay dead")
     cells[0][0] = True
     self.assertEqual(False, game.should_live(0, 0, cells), "Should die")