Exemplo n.º 1
0
    def test_can_create_an_empty_grid(self):

        game = GameOfLife(width=3, height=3, cell_size=1)

        clist = game.cell_list(randomize=False)

        self.assertEqual([[0, 0, 0], [0, 0, 0], [0, 0, 0]], clist)
Exemplo n.º 2
0
    def test_can_create_a_random_grid(self):

        game = GameOfLife(width=3, height=3, cell_size=1)

        random.seed(12345)

        clist = game.cell_list(randomize=True)

        self.assertEqual([[1, 0, 1], [1, 0, 1], [1, 0, 1]], clist)