letrand=newSystem.Random()letswapxy(a:_array)=lettmp=a.[x]a.[x]<-a.[y]a.[y]<-tmp// shuffle an array (in-place)letshufflea=Array.iteri(funix->x|>swapi(rand.Next(i,Array.lengthx)))
val rand : System.Random
namespace System
Multiple items type Random = new : unit -> Random + 1 overload member Next : unit -> int + 2 overloads member NextBytes : buffer:byte[] -> unit + 1 overload member NextDouble : unit -> float