Skip to content

Instantly share code, notes, and snippets.

@nedzadarek
Created August 9, 2014 18:25
Show Gist options
  • Save nedzadarek/8bf0c72ee50373ca1b06 to your computer and use it in GitHub Desktop.
Save nedzadarek/8bf0c72ee50373ca1b06 to your computer and use it in GitHub Desktop.
def correct? input
if 24 == input
puts "great job! you did it!"
true
else
puts "please try again"
false
end
end
while true
begin
user_input = gets
int = Integer user_input
break if correct? int
rescue ArgumentError => e
puts "invalid characters entered"
puts "please try again"
puts
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment