Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
open FsCheck
let newDeck =
[ for r in [1..14] do
yield ("C",r)
yield ("H",r)
yield ("D",r)
yield ("S",r) ]
let genFullShuffledDeck =
gen
{ let shuffled =
newDeck
|> List.sortBy (fun _ -> Gen.sample 1 1 (Gen.choose(0, System.Int32.MaxValue)) )
return shuffled }
let shuffle items =
gen
{ return
items
|> Seq.sortBy (fun _ -> Gen.sample 1 1 (Gen.choose(0, System.Int32.MaxValue)) ) }
let sh = genFullShuffledDeck
sh |> Gen.sample 1 1
let sh2 = shuffle [1..50]
sh2 |> Gen.sample 1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment