def search(col, row):
    print(f'search({col}, {row})')
    pygame.display.update()
    if (grid[(col, row)] == TERMINAL):
        return True
    if (grid[(col, row)] in [WALL, VISITED, PATH]):
        return False
    if (grid[(col, row)] != INITIAL):
        grid[(col, row)] = PATH
        draw_cell(PATH_CELL_COLOR, col, row)
        if check((col - 1), row):
            return True
        if check((col + 1), row):
            return True
        if check(col, (row - 1)):
            return True
        if check(col, (row + 1)):
            return True
        grid[(col, row)] = VISITED
        draw_cell(VISITED_CELL_COLOR, col, row)
        return False
def search(col, row):
    print(f'search({col}, {row})')
    pygame.display.update()
    if (grid[(col, row)] == TERMINAL):
        return True
    if (grid[(col, row)] in [WALL, VISITED, PATH]):
        return False
    if (grid[(col, row)] != INITIAL):
        grid[(col, row)] = PATH
        draw_cell(PATH_CELL_COLOR, col, row)
        if check((col - 1), row):
            return True
        if check((col + 1), row):
            return True
        if check(col, (row - 1)):
            return True
        if check(col, (row + 1)):
            return True
        grid[(col, row)] = VISITED
        draw_cell(VISITED_CELL_COLOR, col, row)
        return False