Skip to content

Instantly share code, notes, and snippets.

@illbzo1
Created November 10, 2011 02:37
Show Gist options
  • Save illbzo1/1353942 to your computer and use it in GitHub Desktop.
Save illbzo1/1353942 to your computer and use it in GitHub Desktop.
Random Phrase Generator
files = Dir.glob("*.txt")
adjective_list1 = IO.readlines("adj1.txt")
adjective_list2 = IO.readlines("adj2.txt")
noun_list = IO.readlines("noun.txt")
prefix_list = IO.readlines("prefix.txt")
suffix_list = IO.readlines("suffix.txt")
rand1 = rand(adjective_list1.length)
rand2 = rand(adjective_list2.length)
rand3 = rand(noun_list.length)
rand4 = rand(prefix_list.length)
rand5 = rand(suffix_list.length)
adj1 = adjective_list1[rand1].capitalize
adj2 = adjective_list2[rand2].capitalize
noun = noun_list[rand3].capitalize
prefix = prefix_list[rand4].capitalize
suffix = suffix_list[rand5].capitalize
new_phrase = []
randomizer = rand(7)
case randomizer
when 1..2
new_phrase << [adj1, adj2, noun, suffix]
when 6..7
new_phrase << [prefix, adj1, adj2, noun]
else
new_phrase << [adj1, adj2, noun]
end
puts "Generate new phrase?"
input = gets.chomp()
if input == "yes"
puts new_phrase
end
super
hyper
ultra
legendary
robotic
operation
virtual
ultimate
unforgettable
unruly
dangerous
fearsome
mystical
magical
detectives
turtle
wombat
operatives
wizard
polar bear
legend of the
return of the
revenge of the
adventures of the
battle of the
quest of the
secret of the
tournament of the
learn to read with the
clash of the
jr.
strike back
the revenge
strike back
back for more
surf's up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment