Commits

Yaron Minsky committed 6f8504d

added manhattan metric to vec

Comments (0)

Files changed (2)

   { x = t1.x + t2.x
   ; y = t1.y + t2.y
   }
+
+let manhattan_distance t1 t2 =
+  Int.abs (t1.x - t2.x) + Int.abs (t1.y - t2.y)
 type t = Export._vec with sexp, bin_io
 
 val add : t -> t -> t
+val manhattan_distance : t -> t -> int