B-tapemark

From Esolang
Jump to navigation Jump to search

B-tapemark is an esolang invented by User:Zzo38.

The playfield consists of two unbounded grids. The first one is filled up by the program file. The second one is initially blank. Each one has a position marker on it. There is also a current direction, common to both grids.

The operation is that the symbol on the first grid is executed and then the position marker is moved in the current direction.

Symbols

  • Blank: A blank symbol, represented by a space.
  • \, /: Mirrors.
  • !: Halt.
  • +: Output the symbol at the position marker of second grid.
  • -: If the symbol at position marker of second grid is blank, input a symbol there.
  • *: Read the next symbol from the program (and skip it). If the symbol at the position marker on the second grid is blank, write the read symbol there.
  • |: Move the position marker of the second grid in the current direction.
  • ?: Swap the grids if the symbol on the second grid is blank.
  • %: Swap the grids if the symbol on the second grid is not blank.
  • A...Z, 0...9: If direction is horizontal, output this symbol. If direction is vertical, compare symbol on second grid with this one; swap grids if they match.

Pseudosymbols

  • ^, v, <, >: The starting position and direction. This symbol is blank at runtime.
  • ": Any text in quotation marks is comments and is converted to blanks at runtime.
  • Everything else is error (when the program is loaded).

Examples

Hello World:

>HELLO+WORLD!

Copy input to output:

/>-+|\
\    /