Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created November 11, 2015 03:25
Show Gist options
  • Save anonymous/e1d4571c44136a73eb6a to your computer and use it in GitHub Desktop.
Save anonymous/e1d4571c44136a73eb6a to your computer and use it in GitHub Desktop.
print "Give me a four letter word:"
fourword = gets.chomp
if fourword == nil
print "You need to give me some input first."
elsif fourword.length == 4
print "Well done. '#{fourword}' appears to be 4 characters long."
elsif fourword =! nil and fourword.length < 4
print "#{fourword} has too few characters."
elsif fourword.length > 5
print "#{fourword} has too many characters."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment