samedi 10 décembre 2016

Random Number between 1 and 0 in matrix ocaml

I am trying to build a matrix in OCaml consisting only of 1 and 0. My current code is

let myArray = Array.make_matrix num num2 (Random.int 2) in 
  print myArray

However this fills the entire array up with only 0 or only 1, and not a combination, is there a way for me to do what i want?




Aucun commentaire:

Enregistrer un commentaire