Created
December 7, 2014 20:03
-
-
Save JefClaes/3da63f8b74fae5031b5f to your computer and use it in GitHub Desktop.
Spinning the wheel in F#: manipulating the odds (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let rng = new Random() | |
| let random (rng : Random) virtualIndexes = | |
| virtualIndexes |> Seq.nth (rng.Next(0, virtualIndexes |> Seq.length)) | |
| let spin physicalWheel virtualIndexes rng = | |
| physicalWheel |> Seq.nth (random rng virtualIndexes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment