Created
December 28, 2012 02:38
-
-
Save brianium/4394010 to your computer and use it in GitHub Desktop.
7 weeks of 7 langues: Ruby Day 1 Bonus Challenge
This file contains hidden or 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
puts "Guess a number between 1 and 10\n" | |
goal = rand(10) + 1 | |
until((answer = gets.chomp) == goal.to_s) | |
puts "Too low\n" if answer.to_i < goal | |
puts "Too high\n" if answer.to_i > goal | |
end | |
puts "Good job! You guessed #{goal} correctly!\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment