Advertisement
ebzzry

Untitled

Aug 12th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.45 KB | None | 0 0
  1. let table n =
  2.   let tab = Array.make n (Array.make n 0) in
  3.   let max = pred n in
  4.   for x = 0 to max do
  5.     let count = ref 1 in
  6.     for y = 0 to max do
  7.       tab.(x).(y) <- (succ x) * !count;
  8.       Printf.printf "tab.(%d).(%d): %d\n" x y tab.(x).(y);
  9.       count := (succ !count)
  10.     done;
  11.     print_char '\n'
  12.   done;
  13.   for x = 0 to max do
  14.     for y = 0 to max do
  15.       Printf.printf "tab.(%d).(%d): %d\n" x y tab.(x).(y);
  16.     done;
  17.   done;
  18.   tab
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement