2 ms·
I've been working on a chess engine as a side project. Often, using print statements is the best way to chase down certain bugs where using a debugger isn't par
by mtlmtlmtlmtl 4y ago
I've been working on a chess engine as a side project. Often, using print statements is the best way to chase down certain bugs where using a debugger isn't particularly feasible.
E.g if there's some bug in my search function resulting in weak play, but it only shows up at higher search depths for some reason. The search function is recursive, and the number of nodes visited grows approximately with sqrt(b^d) in the best case with ideal pruning. b is the branching factor(in chess this is ~30) and d is the search depth. That's billions of stack frames to look at. The only way I've found of debugging these is through print statements and grep/awk. As well as programming it to generate some statistics that may or may not be helpful. I've yet to find much use from debuggers.