# Another really subtle bug

**URL:** <https://www.ruby-forum.com/t/another-really-subtle-bug/147313>\
**Category:** Ruby\
**Created:** [August 30, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/another-really-subtle-bug/147313 "2008-08-30T22:24:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [August 30, 2008, 10:24pm UTC](https://www.ruby-forum.com/t/another-really-subtle-bug/147313/1 "2008-08-30T22:24:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [August 30, 2008, 10:58pm UTC](https://www.ruby-forum.com/t/another-really-subtle-bug/147313/2 "2008-08-30T22:58:12Z")

</div>

> Any guesses on what might be happening?
> 
> -Patrick

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

---

<div class="post-metadata">

**Author:** ![lynchnco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/c77e96/32.png) [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Post date:** [August 30, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/another-really-subtle-bug/147313/3 "2008-08-30T23:54:15Z")

</div>

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

Thanks Roger.
