just thought id share a pretty basic thing that i came up with while getting stuck in many-a-endless loop.
Code:
int goneToFar = 0;
boolean mainLoopSetter = true;
while(mainLoopSetter || goneToFar > 100)
{
//do whatever to set mainLoop false
goneToFar++; //this added to exit out if the other doesn't get set
}
its pretty simple, and i've only used it once, but not only does it stop from crashing your computer and very quickly running out of memory but it may even force you to see the problem for the loop before you even test it...
--EDIT--
oops.. changed to OR and greater then
--EDIT--