Calculating distance of shortest path to each point.
  h=height w=width
  a=array of integers (-1 means non visited; n>=0 means distance n)

First attempt: icfp0.ml
  starting from a list l of nodes with current distance dist,
  calculate the yet-unvisited nodes reachable in one more step (list l')
user time for 1000x1000: 6.5sec (my laptop)  TOO MUCH!!!

Second attempt: icfp0b.ml
  replace List.iter with a while loop
user time for 1000x1000: 6 sec  MODEST IMPROVEMENT

Third attempt: icfp1.ml
  points are number (index into the array) instead of pairs of coords
  need modulo and division to calculate next points
user time for 1000x1000: 2.9 sec SURPRISINGLY BIG IMPROVEMENT

Fourth attempt: icfp2.ml
  array has a frame of fake nodes ffffff
                                  f....f
				  ffffff
  fake nodes represented as zeros (num does not matter as long as >=0)
  advantage: no need to check if you're at the border
user time for 1000x1000: 2.4 sec  STILL NOT ENOUGH

tried the profiler: the gc uses up a lot of time
need to bypass the gc

Fifth attempt: icfp3.ml
  don't bother with lists, but use a queue represented as an array
  only thing: need to know when we move from one step to the next (in terms of
  distance from the origin)
  array q from position !l to position !l' containing the value -2 somewhere in
  the middle: when we meet -2, increment the distance and add a -2 at the end
  other thing: check if nodes have been visited before adding them to the
  queue
  quality of code: nearly unreadable, and could not be bothered to implement a
  circular queue, so allocate a "big enough" array - easy to change
user time for 1000x1000: 0.35 sec  THAT'S OK NOW

