Backtracking INTERCAL

From Esolang
Jump to: navigation, search

Backtracking INTERCAL is an extension of INTERCAL by Malcolm Ryan to include backtracking like in Prolog.

  • A MAYBE tag on a statement creates a choice point, containing the entire state of the program except ABSTAIN/REINSTATE status, after which the statement is performed normally.
  • A GO BACK statement backtracks to the most recent choice point, redoing the statement in the negated sense, ignoring it if it is active and performing it if it is abstained from.
  • A GO AHEAD statement eliminates the most recent choice point from the stack.

See also

External resources