Location

mutalyzer_crossmapper.location.nearest_location(ls, c, p=0)

Find the location nearest to c. In case of a draw, the parameter p decides which index is chosen.

Parameters
  • ls (list) – List of locations.

  • c (int) – Coordinate.

  • p (int) – Preference in case of a draw: 0: left, 1: right.

Returns int

Nearest location.