I have the following method defined within a class.
@heading ||= ‘>’
@history << [@x,@y,@heading]
@y += 1
@y -= 1
@x -= 1
@x += 1
error_out(“Infinite Loop”) if @history.include?([@x,@y,@heading])
which works as expected on my linux machine. However, when I try the
same code on OS X the
error_out("Infinite Loop") if @history.include?([@x,@y,@heading])
fails to execute correctly. In other words, even if [@x,@y,@heading]
exists in @history the error_out is never executed. I have verified that
it does exist by printing the contents of the @history array before the
This is a single threaded application and in no other place is @history
I first ran on OS X with ruby version 1.8.2 and then installed 1.8.7
with the same results. I am running version 1.8.7 on my linux machine.
Is there an obvious thing that I am missing here?