Most voted "ocaml" questions
3 questions
Sort by count of
-
1
votes0
answers33
viewsHow to return the lists of a list in ocaml?
I don’t know how to return the lists of a list in the language ocaml. For example: wanted to give the input [["Preto";"Branco"];["Amarelo";"Vermelho"]] return ["Preto";"Branco"] and then…
-
1
votes1
answer81
viewsOcaml vs Python - Function return value
I have the following function written in ocaml let rec pow((x:int), (y:int)) : int = if y=0 then 1 else x * pow(x,y-1) ;; let pr = 13;; let bs = 31;; let getvalor num ch1 ch2 tam = (num * bs +…
-
0
votes1
answer31
viewsWrite word in succession until the end of the cycle
let palavra="1234567";; let tamanho=String.length palavra;; for i = 0 to 6 do print_string String.sub palavra i (tamanho-i); print_string "\n"; done;; I tried to execute the code, but it won’t…