Skip to content

Instantly share code, notes, and snippets.

@monkieboy
Last active April 18, 2016 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkieboy/8eb65012e3e33eb2fe464eae511417ae to your computer and use it in GitHub Desktop.
Save monkieboy/8eb65012e3e33eb2fe464eae511417ae to your computer and use it in GitHub Desktop.
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