예제 #1
0
    def test_print_map(self):
        # arrange
        s = SpaceMap([1101, 100, -1, 4, 0])
        m = [
            '#.........', '.#........', '..##......', '...###....',
            '....###...', '.....#O##.', '......####', '......####',
            '.......###', '........##'
        ]

        # act
        points = s.LoadMap(m)
        lines = s.PrintSpaceMap()

        # assert
        self.assertEqual(lines, 10)
예제 #2
0
    def test_write_beam_map(self):
        # arrange
        infile = open('data/input_19.txt', 'r')
        program = infile.readline().strip().split(',')
        # program[0] = 2
        a = SpaceMap(program)
        result = []

        # act
        print()
        result = a.WriteBeamMap()
        a.PrintSpaceMap()
        print(a.GetAffectedCells())

        # assert
        self.assertEqual(result, 2500)