I've been working on this for a while now, and I've got it to the point where it almost works, but not quite. It's really frustrating and I can't figure out where my logic is going wrong.
http://uranther.pastebin.com/584302 <-- the code
Line 94 is just to check the progress of the solve() function for debugging purposes. I think I have all the structure in place but somewhere my logic has gone wrong, hopefully. Can someone help me with this program? I'd greatly appreciate it.Code: