random in f# code example
Example: random in f#
let alph = "abcdefg"
let randomCh =
let random = Random()
fun () -> alph.Chars (random.Next (alph.Length - 1))
printfn "%O" <| randomCh()
printfn "%O" <| randomCh()
let alph = "abcdefg"
let randomCh =
let random = Random()
fun () -> alph.Chars (random.Next (alph.Length - 1))
printfn "%O" <| randomCh()
printfn "%O" <| randomCh()