def find_path(self, pos_x, pos_y):
    self.grid[pos_y][pos_x].visited = True
    if (self.grid[pos_y][pos_x].value == 2):
        print(f'Saida encontrada na posicao [{pos_x}][{pos_y}]!')
    for i in self.order_to_check:
        if ((i == 'up') and (self.grid[pos_y][pos_x].up != None) and (self.grid[pos_y][pos_x].up != 0)):
            if (not self.grid[pos_y][pos_x].up.visited):
                self.find_path(pos_x, (pos_y - 1))
        if ((i == 'left') and (self.grid[pos_y][pos_x].left != None) and (self.grid[pos_y][pos_x].left != 0)):
            if (not self.grid[pos_y][pos_x].left.visited):
                self.find_path((pos_x - 1), pos_y)
        if ((i == 'down') and (self.grid[pos_y][pos_x].down != None) and (self.grid[pos_y][pos_x].down != 0)):
            if (not self.grid[pos_y][pos_x].down.visited):
                self.find_path(pos_x, (pos_y + 1))
        if ((i == 'right') and (self.grid[pos_y][pos_x].right != None) and (self.grid[pos_y][pos_x].right != 0)):
            if (not self.grid[pos_y][pos_x].right.visited):
                self.find_path((pos_x + 1), pos_y)
def find_path(self, pos_x, pos_y):
    self.grid[pos_y][pos_x].visited = True
    if (self.grid[pos_y][pos_x].value == 2):
        print(f'Saida encontrada na posicao [{pos_x}][{pos_y}]!')
    for i in self.order_to_check:
        if ((i == 'up') and (self.grid[pos_y][pos_x].up != None) and (self.grid[pos_y][pos_x].up != 0)):
            if (not self.grid[pos_y][pos_x].up.visited):
                self.find_path(pos_x, (pos_y - 1))
        if ((i == 'left') and (self.grid[pos_y][pos_x].left != None) and (self.grid[pos_y][pos_x].left != 0)):
            if (not self.grid[pos_y][pos_x].left.visited):
                self.find_path((pos_x - 1), pos_y)
        if ((i == 'down') and (self.grid[pos_y][pos_x].down != None) and (self.grid[pos_y][pos_x].down != 0)):
            if (not self.grid[pos_y][pos_x].down.visited):
                self.find_path(pos_x, (pos_y + 1))
        if ((i == 'right') and (self.grid[pos_y][pos_x].right != None) and (self.grid[pos_y][pos_x].right != 0)):
            if (not self.grid[pos_y][pos_x].right.visited):
                self.find_path((pos_x + 1), pos_y)