From: Alan Schwarz Date: 2012-04-22T06:09:37+09:00 Subject: Re: While Statement Terminating? Your guesses += 1 is inside of the 4.times do end loop. On Apr 21, 2012, at 13:31, "Solomon W." wrote: > In the attached code, for some reason, the while statement is not > working. > Lets say: > @code = 4213 > @guess = 4144 > it'll print out > + > +- > +-- > +--- > and for some reason terminate the while statement without doing it > again, which it should do, because: > @code != @guess, also, guesses < 4. > Why is it doing this? > > Attachments: > http://www.ruby-forum.com/attachment/7317/cbr.rb > > > -- > Posted via http://www.ruby-forum.com/. >