The purpose of this repository is to provide a way for people to generate random "placeholder text" -- with a Markov Chain.
https://www.craigoates.net/Software/project/12
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
422 B
15 lines
422 B
module internal SystemServices |
|
|
|
open System |
|
|
|
let PickRandomNumber max = Random().Next(1, max); |
|
|
|
(*This needs work. |
|
If the seq passed in has count of 0, |
|
it causes exceptions further up the pipe*) |
|
let PickRandomItem seq = |
|
if (Seq.length seq) = 0 then |
|
seq |> Seq.item 0 |
|
else |
|
let index = Random().Next(0, Seq.length seq); |
|
seq |> Seq.item index |