mercredi 13 avril 2022

How can i get an random value out of an array in OCaml

so i have this

function let init_color() : t_color t_array = 
  {len = 7 ; value = [|blue ; red ; green ; yellow ; cyan ; magenta ; grey|]} ;;

In OCaml and I'm trying to get a random value(color) of of it with another function. And im kinda struggling to do it, new to coding so il be glad to get some help.




Aucun commentaire:

Enregistrer un commentaire