Last active
July 9, 2016 19:47
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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