PlusOrMinus
(Redirected from PlusIntMinus)
PlusOrMinus is an esoteric programming language created by User:PythonshellDebugwindow.
Memory
PlusOrMinus uses a wrapping unsigned 8-bit accumulator (0 to 255) which starts at 0.
Commands
Commands | Meaning |
---|---|
+ |
Increment the accumulator |
- |
Output the Unicode character whose code point is the value of the accumulator, then decrement the accumulator |
All other characters are treated as comments.
PlusIntMinus
PlusIntMinus is an extension of PlusOrMinus which extends the functionality of the +
command.
Commands
Commands | Meaning |
---|---|
+ |
If followed by a positive integer (regex: [0-9]+ ), add that integer to the accumulator; otherwise, add 1 to the accumulator
|
- |
Output the Unicode character whose code point is the value of the accumulator, then decrement the accumulator |
All other characters are still treated as comments.
Variants
PlusOrMinus and PlusIntMinus have two variants, original and modern. In the original variant from November 2019, the accumulator had a range of 0 to 461 inclusive and started at 18; this contrasts with the modern variant, in which the accumulator has a range of 0 to 255 inclusive and starts at 0.
Examples
The following examples use the modern variant.
Hello, World!
In PlusOrMinus
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++-++++++++-+-++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++-++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
In PlusIntMinus
+72-+30-+8-+-+4-+190-+245-+56-+25-+4-+251-+249-+190-
Nope. interpreter
In PlusOrMinus
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++-++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
In PlusIntMinus
+78-+34-+2-+246-+202-
External resources
- Interpreters on GitHub for PlusOrMinus in JavaScript, C, and Python, as well as a code generator for PlusOrMinus written in NodeJS
- An interpreter on GitHub for PlusIntMinus written in JavaScript
- Online interpreter for PlusIntMinus in Interpret Esolangs Online. (JavaScript source is in the talk page)
- Online interpreter for PlusOrMinus in Interpret Esolangs Online. (JavaScript source here)
- Interpreters at Code Golf Stack Exchange