Skip to content

Instantly share code, notes, and snippets.

@Asimov4
Created April 14, 2012 00:45
Show Gist options
  • Save Asimov4/2381209 to your computer and use it in GitHub Desktop.
Save Asimov4/2381209 to your computer and use it in GitHub Desktop.
Caml test
let altitude = fun n ->
let t = make_matrix (n+2) (n+2) 0 in
for i=1 to n do
for j=1 to n do
t.(i).(j) <- 2
done;
done;
t.(n).(n) <- 1;
let rec aux = fun (u,v) -> match (u,v) with
(u,v) when t.(u).(v) != 2 -> t.(u).(v)
|(u,v) -> aux(u+1,v) + aux(u,v+1)
in aux (1,1);;
altitude 10;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment