REVERSE

From Esolang

Jump to: navigation, search
This article is a stub, which means that it is not detailed enough and needs to be expanded. Please help us by adding some more information.

REVERSE is an esoteric programming language devised by Brian C. Smith. It supports control flow only by reversing direction, top to bottom or bottom to top. Decision making is done by reversing as well.

Cat in REVERSE is:

 SKIP REVERSE GETXA SKIP PUTXA REVERSE<XA

It works like this:

  • First, the SKIP will skip over the REVERSE command.
  • GETXA will get one character from the standard input and store it in the variable XA.
  • Another SKIP will skip over the PUTXA command.
  • REVERSE<XA will reverse the program flow if the variable XA is larger than 0 (i.e. no EOF)
  • If the program flow was reversed, the PUTXA command will now write the variable XA to the standard output.
  • SKIP will skip over the GETXA command.
  • REVERSE will reverse the program flow again.

[edit] External resource

Personal tools