mardi 21 avril 2020

Generating a list of random numbers

I've got a college exercise in OCaml and it's my first month learning this language... I need help on this, I gotta make a function that give a list of random numbers and has a tall given, for example :

'#Random_list 10 10;;

'- : int list = [8; 9; 5; 7; 0; 1; 0; 4; 0; 3]

'#Random_list 10 100;;

'- : int list = [28; 14; 93; 7; 68; 14; 72; 31; 48; 3]

I tried coding some things, but it never works, because I don't understand what is wrong, I usually code in Python and this is extremly hard for me to adapt to OCaml... I got more questions on the sheet that I could only do after this one but I need something to start with... Thanks for you answers ^^




Aucun commentaire:

Enregistrer un commentaire