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 is65
), 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 !
.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++
Prints A
.
++++++++++++++++++++++++++++++++++--
Prints "!
.
Goal
This is code-golf, 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.
-
and+
or should other characters do nothing? \$\endgroup\$+
and-
in the input string (if that's really what you want). At present, this appears clearly as part of the specification of the original language, but not as clearly as a requirement for the challenge. \$\endgroup\$++++++++++++++++++++++++++++++++++--
should output"!
. \$\endgroup\$