Skip to content

Instantly share code, notes, and snippets.

@mayosuke
Created October 27, 2012 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayosuke/3962976 to your computer and use it in GitHub Desktop.
Save mayosuke/3962976 to your computer and use it in GitHub Desktop.
# Run directly from github
# ruby -e "$(curl https://raw.github.com/gist/3962976/)"
randam = rand(10)
while true do
input = gets
number = input[0..-1].to_i
if number == randam
puts 'hit!'
break
elsif number > randam
puts 'big!'
else
puts 'small!'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment