Is there a reason why one writes the line:
(fun max -> rndGen.Next(max))
let NextRandom =
let rndGen = new System.Random(int System.DateTime.Now.Ticks)
(fun max -> rndGen.Next(max))
Instead of just declaring the param max upfront and calling rndGen.Next(max)
, like this?
let NextRandom (max: int) =
let rndGen = new System.Random(int System.DateTime.Now.Ticks)
rndGen.Next(max)
Aucun commentaire:
Enregistrer un commentaire