Skip to main content
8 of 10
stating the obvious: increment/decrement can be arbitrary, but here it is increment/decrement by one

Interpret PlusOrMinus

PlusOrMinus is an esoteric programming language invented by Esolang user PythonshellDebugwindow.

Language specification

There is a wrapping byte accumulator (incrementing 255 results in 0 and decrementing 0 results in 255) in the language. The initial valus of the accumulator is 0.

There are two instructions in the language:

  • +, which increments the accumulator by one.
  • -, which prints the accumulator as ASCII (e.g.: A if accumulator is 65), then decrements the accumulator by one.

Characters that are neither + nor - are ignored.

Examples

Here are some examples to test your programs:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++-++++++++-+-++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++-++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

Prints Hello, World!.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++-++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-

Prints Nope..

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------

Prints ZYXWVUTSRQPONMLKJIHGFEDCBA.

blah

Prints nothing.

+++++++++++++++++++++++++++++++++?-

Prints !.

Goal

This is , so your goal is to use the fewest bytes to interpret the language. The program to interpret can be from a console input, file input or string.

None1
  • 1.1k
  • 3
  • 19