diff options
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}." |