let init width height f = let length = (width*height) in let result = Array.make length (f 0 0) in for i = 0 to pred width do for j = 0 to pred height do set width height result i j (f i j); done; done; result