-
-
Save anonymous/e1d4571c44136a73eb6a to your computer and use it in GitHub Desktop.
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
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