submit HW 2 - secret number

oh yes , > + elsif n = secret_number, should be double equal for boolean
condition

On Sun, Nov 9, 2014 at 11:51 AM, Hubert Lee <notifications@github.com>
wrote:

> In wilsonlam/secret_number_game.rb:
>
> > +	gets.chomp
> > +end
> > +
> > +def check_guess(n, secret_number, remaining)
> > +	remaining -= 1
> > +	if remaining == 0 && n != secret_number
> > +		puts "Sorry you had reached the maximum number of tries"
> > +		puts "The secret number was #{secret_number}"
> > +		exit	
> > +	end
> > +
> > +	if n < secret_number
> > +		puts "Higher...You have #{remaining} guess(es) before the game is over. Please try again"
> > +	elsif n > secret_number
> > +		puts "Lower...You have #{remaining} guess(es) before the game is over. Please try again"
> > +	elsif n = secret_number
>
> What is the purpose of the = operator? What about ==? Do you realize what
> is happening on this line?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ga-students/BEWD_2_HK/pull/12/files#r20056428>.
>