BrainGuck

From Esolang
Jump to navigation Jump to search

BrainGuck is an esoteric language created by User:Periapsis. It was inspired by BrainFuck. It adds a few extra commands:

  • { - Similar to [ except it runs the code only if the cell at the pointer is 0
  • } - jumps back to matching opening loop if cell at pointer is 0
  • ^ - stores one byte of data from the cell into the pointer
  • v - sets current cell to the value stored in the pointer
  • 0 - sets current cell to zero

Examples

Reverse Cat Program

The following cat program queries the standard input for three characters, which should not constitute the null character, and outputs these in the reserve order, utilizing the cell value transfer and resetting operations, as well as both species of goto facilities for forward and backward searches:

,>,>,>+<
{<}^0{>}[>]v.
[<]{<}^0{>}[>]v.
[<]{<}^0{>}[>]v.

Interpreter