We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
+-.%*
+-.%* is an esoteric programming language created by User:3xcpy. It is (kind of) pretty similar to Brainfuck.
Overview
Just like Brainfuck, +-.%* operates on a tape of memory cells. These cells can hold any value between (including) 0 and 255. When a value exceeds these bounds, it wraps around to the opposite end. There is a pointer pointing to the current cell on the tape. The instruction pointer is moved forward by 2 every time an instruction is executed, effectively skipping one character every time. The % command uses this for conditional flow control, as it can essentially switch between the two halves.
| Command | Description |
|---|---|
+ |
Increase the value held by the current cell (the one the pointer points to) by 1 |
- |
Decrease the value held by the current cell by 1 |
> |
Move the pointer one cell to the right (increase the pointer) |
< |
Move the pointer one cell to the left (decrease the pointer) |
% |
Move execution forward by 1 character (instead of 2), if the current cell's value is 0 |
* |
Move execution back to the start of the file |
. |
Print the current cell's value as an ASCII character |
, |
Read a byte from stdin and put it into the current cell |
Other characters are ignored.
Notes
- This idea came to my mind when I was thinking about languages that have only one means of looping: going back to the start of the program. Probably the most famous example of this is Fractran. This kind of language needs some kind of state that carries through the boundary of resetting the instruction pointer. Also, they probably need some way to only go back to the start conditionally (actually, if I think about it, this is not necessary. But it seems like the most natural way to do flow control). I also liked the idea of only evaluating half of the commands (skipping one every time) and having a way to switch between these two. Now that I think about it, this was not really necessary for this language. I could've just added a conditional looping command that resets to the start if the current cell's value is 0. (Edit: That exists now: +.*) 3cxpy (talk)
Examples
+-.%*
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + . + . - - - - - - - - - . + + + + + . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
This prints +-.%* and a newline. (The spaces are necessary)
Computational class
+-.%* is Turing-complete. If it had ability to store arbitrary integers it could easily simulate Minsky machine, but since it does not have it we would translate Turing-machine into it. We would use such tape layout where each TM cell would be represented as three: one would always be 1 for the current cell at the start of a program but can have other values when program is executed, second represents the value and third represents current state. We can see prorgam as having two layers. Program starts with %a-b on the first layer, on second layer (represented as a and b) there would be cell initialization, with each cell except the first translated as x> followed by x> repeated times equal to the index of the symbol and then followed by x>x> (x should be replaced by any NOP or the instruction from the first layer). First cell would be followed by x>x+x> after +x instead. And after initialization there should be x<x<x< repeated for the amount of cells. Then x% is added. Each state transition is done as -a (where a can be any character) done times the index of a symbol that is checked, followed by >a and then followed by -a repeated times the index of a state that is checked, then it is followed by %<a<b+c>d>e% (where letters can be any NOP symbols), then by <x%a<b+c>d%e. Then it is followed by <a-b-c%d. Then a+%b+%c-. First layer would then have instructions which restore values of cells that were dectemented, while second would be state transtitions, and both start and end om a first cell which simulates TM cell which has a value 0. After all state transtitions are done program ends with +a*a where a can be any character.