Skip to content

Instantly share code, notes, and snippets.

@brianium
Created December 28, 2012 02:38
Show Gist options
  • Save brianium/4394010 to your computer and use it in GitHub Desktop.
Save brianium/4394010 to your computer and use it in GitHub Desktop.
7 weeks of 7 langues: Ruby Day 1 Bonus Challenge
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