Skip to content

Instantly share code, notes, and snippets.

@tomash
Created October 21, 2010 13:28
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomash/638477 to your computer and use it in GitHub Desktop.
Save tomash/638477 to your computer and use it in GitHub Desktop.
Metal Lorem Ipsum preview
# Returns a randomly generated sentence of lorem ipsum text.
# The first word is capitalized, and the sentence ends in either a period or
# question mark. Commas are added at random.
def sentence
# Determine the number of comma-separated sections and number of words in
# each section for this sentence.
sections = []
1.upto(rand(5)+1) do
sections << (WORDS.sort_by{rand}.slice(0...(rand(9)+3)).join(" "))
end
s = sections.join(", ")
return s.capitalize + ".?!".slice(rand(3),1)
end
# Returns a randomly generated paragraph of lorem ipsum text.
# The paragraph consists of between 1 and 4 sentences, inclusive.
def paragraph
((1..(rand(3)+2)).map{sentence}).join(" ")
end
WORDS = ['exercitationem', 'perferendis', 'excruciating', 'sphere', 'killing',
'murder', 'iure', 'metal', 'mass', 'black', 'blood', 'haunted', 'vulgar',
'kill', 'unholy', 'satan', 'satanic', 'conjuring', 'demons', 'demonic',
'maims', 'massacre', 'massacres', 'apocalyptic', 'scream', 'screaming',
'slime', 'nordic', 'church', 'leading', 'feasting', 'goat', 'cow',
'acts', 'anger', 'rage', 'terror', 'death', 'scent', 'burning', 'flame',
'undead', 'necro', 'cum', 'flesh', 'chaos', 'decapitate', 'sanity', 'mad',
'crazy', 'cryptic', 'insane', 'cadaver', 'fest', 'feast', 'witch', 'christian',
'devil', 'evil', 'funeral', 'divine', 'horse', 'sword', 'axe', 'ax', 'battle',
'forge', 'monster', 'horror']
puts paragraph
@coffeeaddict
Copy link

Brilliant!

@tomash
Copy link
Author

tomash commented Oct 21, 2010

this is just a preview / quick hack, I'll make it into a full-fledged generator by the end of the week probably :)

@lukaszkorecki
Copy link

Evil!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment