letrand=newSystem.Random()letswapxy(a:'a[])=lettmp=a.[x]a.[x]<-a.[y]a.[y]<-tmp// shuffle an array (in-place)letshufflea=Array.iteri(funi_->a|>swapi(rand.Next(i,Array.lengtha)))
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