Skip to content

Instantly share code, notes, and snippets.

@mlabisi
Created April 5, 2016 23:43
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 mlabisi/3d863ab474784b55a082666665803f50 to your computer and use it in GitHub Desktop.
Save mlabisi/3d863ab474784b55a082666665803f50 to your computer and use it in GitHub Desktop.
def answers(one, two, three, four, five)
puts "I once #{one} a snake. It was lots of fun."
puts "It's hard to go water skiing when you don't have #{two}!"
puts "The longest time she's gone without showering is #{three} days..."
puts "Ever since I was young, I've always wanted a pet #{four}."
puts "Learning Ruby is #{five}!"
end
puts "Welcome to MadLibs: Ruby Edition!"
puts "Press RETURN to begin and CTRL-C (^C) to quit!"
$stdin.gets.chomp
print "verb (past tense): "
verb = $stdin.gets.chomp
print "body part (plural): "
body_part = $stdin.gets.chomp
print "number: "
number = $stdin.gets.chomp
print "animal: "
animal = $stdin.gets.chomp
print "adjective: "
adjective = $stdin.gets.chomp
puts "Creating sentences..."
puts "\n"
puts "Here are your results:"
answers(verb, body_part, number, animal, adjective)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment