Exemple #1
0
 def test_can_create_a_random_grid(self):
     game = GameOfLife(width=3, height=3, cell_size=1)
     random.seed(12345)
     grid = game.create_grid(randomize=True)
     self.assertEqual([[1, 0, 1], [1, 0, 1], [1, 0, 1]], grid)
Exemple #2
0
 def test_can_create_an_empty_grid(self):
     game = GameOfLife(width=3, height=3, cell_size=1)
     grid = game.create_grid(randomize=False)
     self.assertEqual([[0, 0, 0], [0, 0, 0], [0, 0, 0]], grid)