Skip to content

Instantly share code, notes, and snippets.

@futureperfect
Last active July 9, 2016 19:47
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 futureperfect/0021402d71cb9d69215f6416558bb3f2 to your computer and use it in GitHub Desktop.
Save futureperfect/0021402d71cb9d69215f6416558bb3f2 to your computer and use it in GitHub Desktop.
Project #1: Building a hip-hop name generator. https://jdanger.com/getting-started-as-a-software-engineer.html
class RapperNameGenerator
def initialize
@first = ["Young", "Lil'", "Notorious", "MC"]
@last = ["Jeezy", "Chris", "Escher", "Wayne", "Dicky"]
srand
end
def generate
first_index = rand(@first.length)
last_index = rand(@last.length)
"#{@first[first_index]} #{@last[last_index]}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment