The documentation for Array#shuffle states:
Array#shuffle
shuffle(random: rng) → new_ary The optional rng argument will be used as the random number generator. a.shuffle(random: Random.new(1)) #=> [1, 3, 2]
shuffle(random: rng) → new_ary
The optional rng argument will be used as the random number generator.
rng
a.shuffle(random: Random.new(1)) #=> [1, 3, 2]
What does that mean and why would I want to do that?
Aucun commentaire:
Enregistrer un commentaire