def insert(self, cell_value, pos_y, pos_x):
    self.grid[pos_y][pos_x] = Celula.Celula(cell_value)
    try:
        if (self.grid[(pos_y - 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_up(self.grid[(pos_y - 1)][pos_x])
            self.grid[(pos_y - 1)][pos_x].set_down(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[(pos_y + 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_down(self.grid[(pos_y + 1)][pos_x])
            self.grid[(pos_y + 1)][pos_x].set_up(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[pos_y][(pos_x - 1)].get_value() != 0):
            self.grid[pos_y][pos_x].set_left(self.grid[pos_y][pos_x])
            self.grid[pos_y][(pos_x - 1)].set_right(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[(pos_y + 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_right(self.grid[(pos_y + 1)][pos_x])
            self.grid[(pos_y + 1)][pos_x].set_left(self.grid[pos_y][pos_x])
    except IndexError:
        pass
def insert(self, cell_value, pos_y, pos_x):
    self.grid[pos_y][pos_x] = Celula.Celula(cell_value)
    try:
        if (self.grid[(pos_y - 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_up(self.grid[(pos_y - 1)][pos_x])
            self.grid[(pos_y - 1)][pos_x].set_down(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[(pos_y + 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_down(self.grid[(pos_y + 1)][pos_x])
            self.grid[(pos_y + 1)][pos_x].set_up(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[pos_y][(pos_x - 1)].get_value() != 0):
            self.grid[pos_y][pos_x].set_left(self.grid[pos_y][pos_x])
            self.grid[pos_y][(pos_x - 1)].set_right(self.grid[pos_y][pos_x])
    except IndexError:
        pass
    try:
        if (self.grid[(pos_y + 1)][pos_x].get_value() != 0):
            self.grid[pos_y][pos_x].set_right(self.grid[(pos_y + 1)][pos_x])
            self.grid[(pos_y + 1)][pos_x].set_left(self.grid[pos_y][pos_x])
    except IndexError:
        pass