Skip to content

Instantly share code, notes, and snippets.

@cassyarchibald
Created January 24, 2018 00:17
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 cassyarchibald/dd60ee414d7fbc34b887893c346d43c0 to your computer and use it in GitHub Desktop.
Save cassyarchibald/dd60ee414d7fbc34b887893c346d43c0 to your computer and use it in GitHub Desktop.
ADA Jumpstart - MadLibs Program
# input variables
name = ""
adjective = ""
noun = ""
verb = ""
color = ""
number = ""
animal = ""
sport = ""
town = ""
weather = ""
#program
print "What's your name?"
name = gets.chomp.capitalize
print "Enter an adjective:"
adjective = gets.chomp.downcase
print "Enter a noun:"
noun = gets.chomp.downcase
print "Enter a verb:"
verb = gets.chomp.downcase
print "What's your favorite color?"
color = gets.chomp.downcase
print "What's your favorite number?"
number = gets.chomp.to_i
print "How about your favorite animal?"
animal = gets.chomp.downcase
print "What's your favorite sport?"
sport = gets.chomp.downcase
print "Enter a town:"
town = gets.chomp.capitalize
print "How's the weather?"
weather = gets.chomp.downcase
puts "Okay, ready for the MadLibs!"
print "#{name} saw a #{adjective} #{verb} #{color} #{animal} while on a walk in #{town}. The weather called for #{weather}. #{name} wanted to get home in time to watch #{sport} but needed to buy #{noun} and had #{number} miles left."
@cassyarchibald
Copy link
Author

Also hosted on repl.it at MadLibs.

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