Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exception UJEMNY_ARG;
- let rec makeList (x : int, n : int) =
- match n with
- | 0 -> []
- | _ -> if(n < 0) then raise UJEMNY_ARG
- elif(x % 2 = 0) then List.append [x] (makeList(x + 2, n - 1))
- else (makeList(x + 1, n))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement