It can be coded in C++. That's what the original code VQC posted was, so you'll find it if you go back far enough. Some of us just like Java more, so we rewrote it. Speaking of which, one of the errors with the pdf was in the f input. It had some weird series of variables being input into the grid starting with f. That was a transcribing error on the behalf of the anon who first turned all of that into Java that we've fixed now. e is the distance between c and the square below it. f is the distance between c and the square above it, so what we're actually doing with f is inputting c in negative space (so if you've seen any of those symmetrical-ish bitmaps, the negative space on the left is the same variables with e replaced by f and n replaced by n-1). Just thought I'd clear that up in case you didn't figure it out.
I feel like I'm talking to a brick wall.