Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 326 Bytes

README.md

File metadata and controls

15 lines (12 loc) · 326 Bytes

Enumeration of integers

Write a function with type

enum_int : int -> int

which maps each natural number to an integer, producing the following enumeration:

0 -1 1 -2 2 -3 3 ...

Your function must pass the test:

assert (List.init 10 enum_int = [0; -1; 1; -2; 2; -3; 3; -4; 4; -5]);;