Created
June 3, 2016 06:36
-
-
Save anonymous/c0c4300baf806b2be472b72dca041a8b 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
name=nil | |
loop do | |
print "Enter name: " | |
name = gets.chomp | |
break if (name.to_s) !~ /[0-9]/ | |
puts "Invalid name. Please try again." | |
end | |
puts "Hello #{name}!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment