Wow! The code isn’t even super contrived to get to that line count, and this guy made some really nice test images, like this cute forest.
The code isn’t that contrived but the formatting definitely is. See my comment here about it:
I hacked on it and it ended up around 500-800 lines written in a more conventional style.