(* ocaml wall hugger for laby *) let ant = (* go straight ahead til we hit something *) while (Robot.look () = `Void) do Robot.forward (); done; (* main wall hugin' loop *) while not (Robot.look () = `Exit) do if (Robot.look () == `Void) then ( Robot.forward (); Robot.right (); ); if (Robot.look () == `Rock) then ( Robot.take (); Robot.forward (); Robot.left (); Robot.left (); Robot.drop (); Robot.left (); ); if (Robot.look () == `Wall) or (Robot.look () == `Web) then Robot.left (); done; Robot.door_open (); ;;