While Statement Terminating?

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/.

Your guesses += 1 is inside of the 4.times do end loop.

···

On Apr 21, 2012, at 13:31, "Solomon W." <lists@ruby-forum.com> 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/\.