예제 #1
0
    def drawPath(self):
        if self.slow:
            Map.setCell(self.p1, Map.YELLOW_CELL)

            if self.can_draw:
                Map.setWall(self.p_wall, Map.RED_WALL)

        if self.finished:
            Map.setWall(self.old_p_wall, Map.EMPTY)
예제 #2
0
    def applyAlgorith(self):
        if self.old_p_wall is not None:
            Map.setWall(self.old_p_wall, Map.EMPTY)

        self.p1, dir = self.all_walls.pop()

        self.p_wall = self.p1 + dir / 2

        p2 = self.p1 + dir

        self.can_draw = False

        repr_p1 = self.id_map.find(self.p1)
        repr_p2 = self.id_map.find(p2)

        if repr_p1 != repr_p2:
            self.can_draw = True

            self.id_map.union(self.p1, p2)

            self.old_p_wall = self.p_wall

            self.edited_wall_count += 1