Commits

Roma Sokolov committed 31e2a2f

undev task

  • Participants
  • Parent commits f576cd8

Comments (0)

Files changed (1)

+let can_exit path =
+  let rec check step_count rest =
+    match rest with
+      | (h::t) ->
+          if step_count > 0 then
+            (check (step_count - 1) t) or (check h t)
+          else
+            false
+      | _ -> true
+  in
+    try
+      check (List.hd path) (List.tl path)
+    with Failure "hd" | Failure "tl" -> false