Skip to content

Instantly share code, notes, and snippets.

@QuinnStephens
Last active June 10, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save QuinnStephens/aaa3a36d410e56222e506c2b50526102 to your computer and use it in GitHub Desktop.
Save QuinnStephens/aaa3a36d410e56222e506c2b50526102 to your computer and use it in GitHub Desktop.
@adjectives = [
'ancient', 'magic', 'mystic', 'curious', 'secret', 'hidden', 'forgotten',
'forsaken', 'forbidden', 'exhumed', 'cursed', 'unseen', 'banished',
'frozen', 'crystal', 'diamond', 'ruby', 'emerald', 'sapphire', 'silver',
'golden', 'amber', 'gilded', 'dark', 'darkened', 'darkening', 'moonlit',
'sunlit', 'abyssal', 'deep', 'sacred', 'exalted', 'hunted', 'cold',
'ashen', 'abandoned', 'shining', 'glowing', 'illuminated', 'misty',
'desecrated', 'red', 'blue', 'green', 'violet', 'purple',
'indigo', 'orange', 'cerulean', 'jade', 'rose', 'scarlet', 'crimson',
'winged', 'burning', 'burned', 'drowned', 'sunken', 'shattered',
'broken', 'sundered', 'royal', 'imperial', 'shadowed', 'distant'
]
@things = [
'pendant', 'talisman', 'ring', 'necklace', 'gauntlet', 'crown', 'tiara',
'locket', 'shield', 'sword', 'mace', 'lance', 'wand', 'catalyst', 'rope',
'blade', 'dagger', 'stiletto', 'scimitar', 'katana', 'saber', 'bow',
'arrow', 'arrowhead', 'flute', 'lute', 'cloak', 'hood', 'mark', 'brand',
'horse', 'eagle', 'hawk', 'falcon', 'serpent', 'claw', 'talon', 'scale',
'unicorn', 'cape', 'tunic', 'legend', 'saga', 'tale', 'song', 'king',
'queen', 'prince', 'princess', 'baron', 'baronness', 'duke', 'dutchess',
'emperor', 'empress', 'ship', 'fleet', 'chariot', 'army', 'navy',
'goblin', 'troll', 'elf', 'fairy', 'hermit', 'exile', 'prisoner',
'god', 'goddess', 'demon', 'wizard', 'witch', 'sorcerer', 'sorceress',
'mage', 'warlock', 'warrior', 'champion', 'knight', 'thrall',
'mercenary', 'sellsword', 'rogue', 'thief', 'page', 'apprentice',
'scoundrel', 'scholar', 'assassin', 'tome', 'book', 'scroll', 'journal',
'shadow', 'torch', 'flame', 'light', 'staff', 'treasure', 'wings',
'flower', 'tree', 'hollow'
]
@places = [
'kingdom', 'empire', 'barony', 'land', 'nation', 'city', 'world',
'realm', 'forest', 'wood', 'woods', 'plains', 'swamp', 'valley', 'dales',
'dunes', 'desert', 'chasm', 'mines', 'caves', 'caverns', 'depths',
'beach', 'shore', 'coast', 'cliffs', 'ocean', 'sea', 'lake', 'river',
'island', 'islands', 'cove', 'grotto', 'abyss', 'crater', 'hills',
'mountain', 'mountains', 'tomb', 'grave', 'temple', 'catacombs',
'castle', 'fortress', 'palace', 'cathedral', 'tower', 'dungeon',
'dungeons', 'crypt', 'sepulchre', 'mansion', 'outpost', 'village',
'keep', 'pass', 'passage', 'sky', 'shoals', 'ford', 'bridge', 'channel',
'pond', 'falls', 'rapids', 'grove', 'fields', 'tavern', 'prison',
'library', 'archives', 'vault'
]
@actions = [
'roar', 'song', 'war', 'battle', 'lament', 'ode', 'exodus', 'adventure',
'journey', 'legend', 'tale', 'burning', 'rise', 'return', 'parting',
'end', 'romance', 'shattering', 'scouring', 'hunting', 'chronicle',
'chronicles'
]
@stuff = [
'mist', 'fog', 'fire', 'ice', 'fear', 'hope', 'danger', 'peril',
'wonder', 'life', 'death'
]
@prepositions = [
'beyond', 'within', 'below', 'above'
]
def adjective
"#{@adjectives[rand(@adjectives.count)]}"
end
def place
"#{@places[rand(@places.count)]}"
end
def thing
"#{@things[rand(@things.count)]}"
end
def action
"#{@actions[rand(@actions.count)]}"
end
def the_place
"the #{place}"
end
def the_thing
"the #{thing}"
end
def the_action
"the #{action}"
end
def the_adjective_place
"the #{adjective} #{place}"
end
def the_adjective_thing
"the #{adjective} #{thing}"
end
def stuff
"#{@stuff[rand(@stuff.count)]}"
end
def preposition
"#{@prepositions[rand(@prepositions.count)]}"
end
@structures = [
"#{the_adjective_thing}",
"#{the_adjective_place}",
"#{the_place} of #{stuff}",
"#{the_place} of #{the_adjective_thing}",
"#{the_thing} of #{the_adjective_place}",
"#{the_action} of #{the_thing}",
"#{the_action} of #{the_place}",
"#{the_thing} and #{the_thing}",
"#{preposition} #{the_adjective_thing}",
"#{the_thing}'s #{thing}",
"#{the_thing}'s #{place}",
"#{thing} and #{stuff}"
]
count = ARGV[0] ? ARGV[0].to_i : 1
count.times do
result = @structures[rand(@structures.count)].split(' ').each_with_index do |w, i|
if i ==0 || (!['the', 'of', 'and'].include? w)
w.capitalize!
end
end
puts result.join(' ')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment