def testWorld_ThreeCells_OneLives(self): world = World() world.activate(2, 1) world.activate(2, 2) world.activate(1, 2) world.nextGeneration() self.assertEqual(world.get(1, 1), Alive)
def testWorld_nextGenUpdatesWorldAllTogether(self): world = World() world.activate(1, 1) world.activate(3, 1) world.activate(2, 2) world.nextGeneration() self.assertEqual(world.get(2, 1), Alive)
def testWorld_2Neighbour(self): world = World() world.activate(1,1) world.activate(1, 2) world.activate(2, 1) self.assertEqual(world.neighbours(1, 1), 2) self.assertEqual(world.neighbours(2, 1), 2) self.assertEqual(world.neighbours(1, 2), 2)
def testWorld_Test(self): world = World() world.activate(1, 1) world.nextGeneration() self.assertEqual(world.get(1, 1), Dead)