Created
May 21, 2012 19:35
-
-
Save gnab/2764171 to your computer and use it in GitHub Desktop.
guess.rb
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
number = rand(10).to_i | |
puts "Guess the number!" | |
puts "Wrong answer!" until (gets || '').strip.to_i == number | |
puts "Correct, the number was #{number}." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment