Skip to content

Instantly share code, notes, and snippets.

@jbuda
Created October 19, 2013 00:37
Show Gist options
  • Save jbuda/7050316 to your computer and use it in GitHub Desktop.
Save jbuda/7050316 to your computer and use it in GitHub Desktop.
Ruby - Day 1 - Seven Languages in Seven Weeks
n = rand(100)
input = gets.chomp.to_i
while (input != n) do
puts (input < n) ? "Too low" : "Too high"
input = gets.chomp.to_i
end
puts "Correct! The answer was #{n}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment