Skip to content

Instantly share code, notes, and snippets.

@dydx
Created January 11, 2011 23:59
Show Gist options
  • Save dydx/775419 to your computer and use it in GitHub Desktop.
Save dydx/775419 to your computer and use it in GitHub Desktop.
based on a popular children's book
#light
open System
open System.IO
let getWordList file =
File.ReadAllLines( file )
let rnd = Random()
let getRandArrElement arr =
arr |> Seq.nth (rnd.Next arr.Length)
let wordList1 = getWordList "words1.txt"
let wordList2 = getWordList "words2.txt"
let word1 = getRandArrElement wordList1
let word2 = getRandArrElement wordList2
printf "%s %s" word1, word2
(*
Output:
$>creative_cursing
#jizz waffle
$>creative_cursing
#ball junkie
$>creative_cursing
#nut shitter
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment