Reading a complicated algorithm and then code is a little more than most of us have the time to do.
Type: Posts; User: Norm
Reading a complicated algorithm and then code is a little more than most of us have the time to do.
If it prints -99 that would mean that the code does not change its value.
I don't know the algorithm or logic for your code and can not recommend changes to what it does.
If you don't change the value of move then its value will be the initial value of 0,
To see if the code is changing the value of move, initialize it with a different value like -99. Then if it...
For testing you need to post a small program that will compile, execute and show the problem.
Where is the value of move changed? The posted code does not show where its value is set to 0.
...
Does the printout show you anything? Why is the last value for move set to 0?
The posted code does not show where move is set to 0???
Where is the move variable given values? You need to print out each time the variable is changed.
Having the move variable be public will make it harder to add printlns for all changes.
If there...
Try debugging the code by adding println statements that print out the values of variables used to control the logic. The print out will show you what the computer sees and help you understand what...