private bool ContinueWithCoord( ref int c, int max ) { if ( c < 0 ) { if ( Torus ) c = max - 1; else return false; } else if ( c >= max ) { if ( Torus ) c = 0; else return false; } return true; }