View Single Post
  #3 (permalink)  
Old 06-10-2007, 05:19 PM
AshB
Posts: n/a
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.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!