Quote:
Also, for a program like this, can anyone point out a debugger or technique that will help me fix this myself?
Any debugger will do.
You know what your program should do and how the variables should behave.
You need to execute your program line by line on debugger.
By inspecting the variables while the program runs, you will see if variable behave as expected or not.
where you find where the program stops to behave as expected, you are close to the bug.
When you have a complex expression that give wrong results, it is a good idea to add dummy lines that take parts of the expression just to expose the intermediate calc.
[Update]
when you start a program in debugger, you can run it like normal (like you do) or you can tell the debugger (in the menus) that you want to single step in the program.
I don't know the name in your debugger menu.
usually you have" names like
step
or
trace
the debugger allow you to set
breakpoints
that will stop the program each time it reach that point.