Created
December 14, 2011 14:15
-
-
Save agentfin/1476732 to your computer and use it in GitHub Desktop.
Branching and while
This file contains hidden or 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
# branching again | |
puts 'Hello, world.' | |
puts 'My name is Inigo Montoya. What\'s your name?' | |
name = gets.chomp | |
if name == name.capitalize | |
# be all kinds of sweet | |
puts 'I\'ve always loved the name ' + name + ',' | |
puts '...but I\'m going to call you Pretty-Pretty.' | |
puts 'You\'re very pretty, Pretty-Pretty'.' | |
else | |
# be all kinds of nasty | |
puts 'SAY IT A LITTLE LOUDER ' + name.upcase + '!' | |
reply = gets.chomp | |
while reply.downcase != 'die' | |
# begin harrasing | |
puts reply | |
reply = gets.chomp | |
end | |
puts 'Later doll.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment