Created
January 11, 2011 23:59
-
-
Save dydx/775419 to your computer and use it in GitHub Desktop.
based on a popular children's book
This file contains 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
#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