1
2
3
4
let pyramid n = 
  for i = 1 to n*2 do
    print_endline (String.make (if i<n then i else n*2-i) '*');
  done;;