Skip to content

Instantly share code, notes, and snippets.

@mytrile
Created November 29, 2008 10:07
Show Gist options
  • Save mytrile/30221 to your computer and use it in GitHub Desktop.
Save mytrile/30221 to your computer and use it in GitHub Desktop.
count = 1
print 'Maximum: '
input = gets.to_i
rand = rand(input)
print "Guess :"
guess = gets.to_i
while (guess!=rand)
if guess > rand
puts "High Sky Try !"
else
puts "Too Low !"
end
print "Guess : "
guess = gets.to_i
count+=1
end
puts "You find it after #{count} tries !"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment