Created
January 6, 2013 07:01
-
-
Save 8bit-pixies/4465737 to your computer and use it in GitHub Desktop.
chall115
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
def guess_rank | |
x=rand(100)+1 | |
print "Guess number between 1-100: " | |
guess = x+1 | |
while x!=guess | |
guess = gets.to_i | |
puts "lower" if x<guess | |
puts "higher" if x>guess | |
puts "correct" if x==guess | |
end | |
end | |
guess_rank |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment