I a noobie with ocaml, my problems is how get the digit of an integer in the ocaml and how to put them into a list by recursive calls
OCaml function digits : int -> int list that takes an integer n as an argument and if the integer is positive, returns the list of digits of n in the order in which they appear in n ie:
# digits 3124;;
- : int list = [3;1;2;4]
# let rec digits n =
if n >0 then digits(n/10)::[]
else [];;