Advertisement
Guest User

Untitled

a guest
Nov 10th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. print "Give me a four letter word:"
  2. fourword = gets.chomp
  3.  
  4. if fourword == nil
  5. print "You need to give me some input first."
  6. elsif fourword.length == 4
  7. print "Well done. '#{fourword}' appears to be 4 characters long."
  8. elsif fourword =! nil and fourword.length < 4
  9. print "#{fourword} has too few characters."
  10. elsif fourword.length > 5
  11. print "#{fourword} has too many characters."
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement