Once, I wanted to draw lines on the screen. On a model III.
Man i fought and fought that code. You see, to get good old y=mx+b from a starting point and an end point, you have 2 cases. In one, m is <=1, you can loop with x. If m>1 then you have to loop on y. And I was convinced there was some clever way to do both cases with the same code! Drove me crazy for months!
Then I finally looked it up. Bresenham's Algorithm. Looks at m and then either loops on x or it loops on y. Don't be clever.