Skip to content

Instantly share code, notes, and snippets.

@amieres
Created May 13, 2014 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amieres/5829c37fe6e0c48ae561 to your computer and use it in GitHub Desktop.
Save amieres/5829c37fe6e0c48ae561 to your computer and use it in GitHub Desktop.
public bool Stopping = false;
bool P(rule R) {
if (Stopping) return false;
int StartingPosition = Position;
bool Result = R();
if (!Result && StartingPosition != Position)
Stopping = true;
return Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment