Exemplo n.º 1
0
    def test_step_example1(self):
        grid = dec18.Grid(['.#.#.#',
                           '...##.',
                           '#....#',
                           '..#...',
                           '#.#..#',
                           '####..'])

        expected = dec18.Grid(['..##..',
                               '..##.#',
                               '...##.',
                               '......',
                               '#.....',
                               '#.##..'])

        self.assertEqual(str(expected), str(dec18.step(grid, 1)))
Exemplo n.º 2
0
    def test_broken_grid(self):
        grid = dec18.CornerLitGrid(['##.#.#',
                                    '...##.',
                                    '#....#',
                                    '..#...',
                                    '#.#..#',
                                    '####.#'])
        step = dec18.step(grid, 5)
        expected = dec18.CornerLitGrid(['##.###',
                                        '.##..#',
                                        '.##...',
                                        '.##...',
                                        '#.#...',
                                        '##...#'])


        self.assertEqual(str(expected), str(step))
        self.assertEqual(17, step.count())