let move () =
let move = Array.copy !goal in
for i = 0 to (Array.length move)-1 do
match move.(i) with
| None -> ()
| Some d -> move.(i) <- Some (d-.(get_pos_of_precise i))
done ;
let length = goal_length move in
if length < epsilon || !rem_steps = 0 then
true
else
let movee = Array.make (Array.length !goal) None in
for i = 0 to (Array.length move)-1 do
match move.(i) with
| None -> ()
| Some x ->
let xx = x*.epsilon/.length in
movee.(i) <- Some xx
done ;
try
Printf.printf "===== Step %d ... \n" !rem_steps ;
decr rem_steps ;
elementary_move_precise movee ;
false
with
| e ->
Printf.printf "*** %s ***\n%!"
(Printexc.to_string e) ;
true