A few weeks ago I decided that after taking a break from free software writing in November, I seemed to have recovered sufficient energy (and was going sufficiently stir-crazy) to have a go at doing something non-critical in a relaxed sort of way. Therefore, I started work on a general physics engine for Breakout games (since there are three different Breakout-style games I've been wanting to write for ages, and I thought it'd be obviously sensible to share as much code as possible between them).
Today I sat at the computer for four solid hours, writing a startlingly large amount of worryingly complex code to make this physics engine handle bouncing the ball off the sharp corners of bricks (as opposed to bouncing off brick sides, which I did last month and which is much easier). When I began testing it, there were a couple of really trivial segfault-grade bugs such as using completely the wrong variable as an array index, and I feared that if I couldn't even get that right then there was surely no hope of all the complicated maths being even nearly right. So I was expecting to spend at least another four hours debugging it.
But in fact, after I fixed those few tiny teething troubles and got the new code to actually run, the whole of the rest of it turned out to work perfectly. First time! (Well, there was one actual maths bug it took me a while to track down, but it turned out to be from my last coding session, not from today.)
It's at times like this I begin to think that perhaps I haven't completely lost it.