Another really subtle bug

Hi,
I seem to be running into a lot of subtle bugs lately. This one is
stranger than most.

  def shake
    @engine.inject do
      @engine.run do |key|
        @engine.sleepForTime(key, 0.6) do |timePassed, timeSlept|
          @x = (rand*2-1)*(1-timeSlept)*30
          @y = (rand*2-1)*(1-timeSlept)*30
        end
      end
    end
                      <--- This empty line needs to be here.
  end

My program gives me wrong results when the empty line is not included.
It doesn't throw any syntax error. It just gives me wrong results,
leaving me completely befuddled.
Any guesses on what might be happening?

-Patrick

···

--
Posted via http://www.ruby-forum.com/.

Any guesses on what might be happening?

-Patrick

double check line endings maybe they're messed?
-=R

···

--
Posted via http://www.ruby-forum.com/\.

Yup that was the problem. I moved the file over from a Linux system, and
the line endings got corrupted.

Thanks Roger.

···

--
Posted via http://www.ruby-forum.com/.