From: Paul Lutus Date: 2006-12-05T04:20:05+09:00 Subject: Re: [QUIZ] Turtle Graphics (#104) [SOLUTION] Morton Goldberg wrote: / ... > case > when @heading >= 360.0 > @heading -= 360.0 while @heading >= 360.0 @heading %= 360 > when @heading < 0.0 > @heading += 360.0 while @heading < 0.0 @heading %= 360 # same solution In fact, now that I think about it, the entire block:        case        when @heading >= 360.0           @heading -= 360.0 while @heading >= 360.0        when @heading < 0.0           @heading += 360.0 while @heading < 0.0        end can be replaced with: @heading %= 360 For a net improvement in execution speed and readability. I hope this doesn't come off as golfing, apparently a popular pastime here. -- Paul Lutus http://www.arachnoid.com