minmax_neighbor < neighbors[i] and 65535 != neighbors[i]) \
or ("f" != filter and minmax_neighbor > neighbors[i]):
minmax_neighbor = neighbors[i]
if minmax_neighbor != minmax_start:
dir_to_target = rand_target_dir(neighbors, minmax_neighbor, dirs)
if "f" == filter:
minmax_neighbor < neighbors[i] and 65535 != neighbors[i]) \
or ("f" != filter and minmax_neighbor > neighbors[i]):
minmax_neighbor = neighbors[i]
if minmax_neighbor != minmax_start:
dir_to_target = rand_target_dir(neighbors, minmax_neighbor, dirs)
if "f" == filter: