| Run it through a debugger, and watch the values of move and Pile change. Is move ever great than or equal to half of Pile?
Also, why have you got the for-loop inside a do-loop? That do-loop will run only once, or forever, depending on what the value of Pile is.
-----------
EDIT:
Assuming you have got all the ints and doubles correctly sorted and consistant...
The code will enter the do loop, and then enter the for loop.
The for loop will then, after 5 iterations, set move to (Pile - 63).
Then the while condition will execute, and if Pile is greater than 126, the do loop will start again. Otherwise, it will finish.
You might as well write:
do{
Remainder = 63.0;
move = Pile - 63.0;
}while(move <= Pile/2);
As it would give *exactly* the results. |