Skip to content

Instantly share code, notes, and snippets.

@mscottford
Last active September 4, 2015 18:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mscottford/365055 to your computer and use it in GitHub Desktop.
transformer_names.rb: Used to get a random Transformer character name. Great for naming devices.
class TransformerNames
# source: http://en.wikipedia.org/wiki/List_of_The_Transformers_characters#Autobots
AUTOBOTS = ['Teletraan', 'Optimus Prime', 'Wheeljack', 'Bumblebee',
'Cliffjumper', 'Prowl', 'Jazz', 'Sideswipe', 'Ratchet', 'Ironhide', 'Hound',
'Mirage', 'Trailbreaker', 'Sunstreaker', 'Bluestreak', 'Windcharger',
'Brawn', 'Huffer', 'Gears', 'Skyfire', 'Grimlock', 'Slag', 'Sludge',
'Snarl', 'Swoop', 'Warpath', 'Tracks', 'Grapple', 'Blaster', 'Red Alert',
'Smokescreen', 'Perceptor', 'Seaspray', 'Hoist', 'Powerglide',
'Beachcomber', 'Inferno', 'Cosmos', 'Omega Supreme', 'Devcon', 'Skids',
'Alana', 'Elita One', 'Chromia', 'Firestar', 'Moonracer', 'Alpha Trion',
'Silverbolt', 'Air Raid', 'Slingshot', 'Skydive', 'Fireflight', 'Superion',
'Streetwise', 'Groove', 'First Aid', 'Hot Spot', 'Blades', 'Defensor',
'Hot Rod', 'Kup', 'Ultra Magnus', 'Blurr', 'Springer', 'Arcee', 'Steeljaw',
'Ramhorn', 'Eject', 'Rewind', 'Wheelie', 'Rodimus Prime', 'Outback',
'Broadside', 'Pipes', 'Swerve', 'Tailgate', 'Metroplex', 'Sky Lynx',
'U-Haul Robot', 'Sandstorm', 'Beta', 'Nosecone', 'Lightspeed', 'Strafe',
'Scattershot', 'Afterburner', 'Computron', 'Chase', 'Freeway', 'Rollbar',
'Searchlight', 'Wideload', 'Goldbug', 'Punch-Counterpunch', 'Sureshot',
'Hardhead', 'Chromedome', 'Pointblank', 'Brainstorm', 'Highbrow',
'Cerebros', 'Crosshairs', 'Fastlane/Cloudraker', 'Fortress Maximus']
# source: http://en.wikipedia.org/wiki/List_of_The_Transformers_characters#Decepticons
DECEPTICONS = ['Megatron', 'Skywarp', 'Starscream', 'Thundercracker',
'Soundwave', 'Laserbeak', 'Shockwave', 'Reflector', 'Rumble', 'Ravage',
'Frenzy', 'Shrapnel', 'Bombshell', 'Kickback', 'Hook', 'Scrapper',
'Bonecrusher', 'Long Haul', 'Scavenger', 'Mixmaster', 'Devastator',
'Buzzsaw', 'Thrust', 'Ramjet', 'Blitzwing', 'Dirge', 'Astrotrain',
'Deceptitran', 'Motormaster', 'Drag Strip', 'Dead End', 'Breakdown',
'Wildrider', 'Menasor', 'Brawl', 'Swindle', 'Blast Off', 'Vortex',
'Onslaught', 'Bruticus', 'Ratbat', 'Galvatron', 'Cyclonus', 'Scourge',
'Octane', 'Trypticon', 'Tantrum', 'Rampage', 'Headstrong', 'Razorclaw',
'Divebomb', 'Predaking', 'Runamuck', 'Runabout', 'Rippersnapper', 'Blot',
'Sinnertwin', 'Cutthroat', 'Hun-Grrr', 'Abominus', 'Slugfest', 'Overkill',
'Triggerhappy', 'Weirdwolf', 'Skullcruncher', 'Misfire', 'Mindwipe',
'Apeface', 'Snapdragon', 'Pounce/Wingspan', 'Sixshot', 'Slugslinger',
'Scorponok', 'Unicron']
def self.random
all.sample
end
def self.random_autobot
AUTOBOTS.sample
end
def self.random_decepticon
DECEPTICONS.sample
end
def self.all
AUTOBOTS + DECEPTICONS
end
end
puts TransformerNames.random
puts TransformerNames.random_autobot
puts TransformerNames.random_decepticon
@jpfuentes2
Copy link

Hah. Are you using ancient Rubies here? What about Array#sample.

@jpfuentes2
Copy link

Oh, I can't read. This was from 2 years ago.

@monkseal
Copy link

@mscottford you should try Array#sample 👍

@mscottford
Copy link
Author

Fine! I just did. :)

@kiere
Copy link

kiere commented Apr 30, 2014

No way! #random_element is where it's at! ;)

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