HW #1

It took me a while to figure out a way to exit out of the program immediately when the user inputs a correct number. I first used return 0, but it gave me error: "ruby localjumperror unexpected return". Then I figured it out searching on google and used the "exit" method instead. Also I wasn't sure how often I should comment on our code. Is it appropriate to comment on each if statement?

Regarding the git I tried to fix the comments on commit and uncommited everything and lost the changes accidently using the following command. (git reset --hard HEAD^).
As I've said, using instance variables here is not best practice (I'm not even sure why it seems to work). However, your idea of encapsulating this process in a method is a good one. How about this instead?
```ruby
def check_number(max)
    begin
        print "Guess a number between 1 and #{max}: "
        guess = gets.chomp.i
    end while guess < 0 or guess > max
    guess
end