diff options
author | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2018-11-20 11:17:15 +0000 |
---|---|---|
committer | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2018-11-20 11:17:15 +0000 |
commit | aad6a3bff2ef3914f7d7c5da5a0ec4d65fdee0ac (patch) | |
tree | 7cb778daaf50f18d31a91de169620171f825738d /thing.rb |
Diffstat (limited to 'thing.rb')
-rwxr-xr-x | thing.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/thing.rb b/thing.rb new file mode 100755 index 0000000..97e932f --- /dev/null +++ b/thing.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +load "superlatives" +load "nouns" +load "adjectives" + +def flip(bias = 0.5) + return rand < bias +end + +adjectives = [ + flip(0.25) ? " #{$adjectives.sample}" : "", + flip(0.75) ? " #{$adjectives.sample}" : "" +] + +puts "The #{$superlatives.sample}#{adjectives[0]} thing since#{adjectives[1]} #{$nouns.sample}." |