So... after reading THIS thread, I was enthused by Dropzone's attempt at the problem. I thought I could better it. The problem is to try pack all the xkcd comics into as small square/rectangle as possible. So effectively it's a sort of 2d box packing problem. Now, I have little experience (if not none) with these kind of algorithms, but I trying to make my own. So far it's around 500 lines in C#.

It works by searching for the closest point to the centre via a square spiral pattern, then, depending which direction it's headed, it will search either right/down/left/up for N/S/E/W respectively. Since it's a spiral, the outside edge will always have space and the largest that can fit in there will be placed. If not, if will find the largest rectangle that would contact 3 sides* and invalidate it so the search misses that area next time. Little hard to explain and, annoyingly, it's a bit hard to find descriptive comments.

*I've not taken into account ones that contact 2 sides (e.g. The spiral is at the bottom left going clockwise and just about to go north, there may not be an edge downward in a few cases), which only matters for very few cases, but wouldn't provide optimal packing without it.

My head's hurting just working out the maths of it. Working out what x/y location would be for the Nth step of a square spiral was hard enough (An optimisation rather than incrementing the spiral from the start hundreds of thousands of times) since I haven't done maths for 5 years (Also, I nearly failed it back then).

Here is the most recent test done on only a selection of 112 of the 500+ comics (Note: I only left it to do some)...

**Spoiler:**