a lil esoteric language based on an expanding tape reel
ReeL has a looping tape reel, every "cell" contains one int value and a "mark" (we'll get to those later). As many languages, the tape has a pointer and you can only interact with the cell selected by it (named "active cell"). You also have a stack to work with, just to facilitate the trasfer of data.
The main "gimmick" of ReeL is that the tape has only one cell, BUT you can add/remove more with commands.
You can also "mark" different cells with different numbers (every cell starts marked as "0"). I added this so you can "orient" the code better on the tape.
To execute programs, place the .exe in a PATH folder, go in the command line and type "ReeL", the name of the program you want to execute and, optionally, the name of the file from where you take inputs. An example could be "ReeL test.txt inputs.txt" (i'm not familiar with command line but i'm pretty sure it's not case sensitive)
COMMAND | USE |
---|---|
inp | takes an input and places it in the active tape cell |
t++ | increments the active cell by 1 |
t - - | decrements the active cell by 1 |
flp | flips the active cell, from positive to negative and vice-versa |
mrk [V] | marks the active cell as [V] |
t<< | decrements the pointer by 1 (think of it as < in brainfuck) |
t>> | increments the pointer by 1 (like > in brainfuck) |
plc | will add one new cell to the tape (with a value and mark of 0), pushing the active cell forward and becoming the new active cell |
rem | will remove one cell from the tape, it changes the tape in the exact opposite way of "plc" (the active cell is removed and every cell after it is moved back) |
grb | will add the value of the active cell on top of the stack, and leave the active cell as 0 |
add | will add the value of the active cell to the value on top of the stack, and leave the active cell as 0 |
put | will move the top value of the stack to the active cell |
len | will set the active cell to the lenght of the stack |
dup | will duplicate the top value of the stack, like in concatenative programming |
nil | will remove the top value of the stack, like "pop" in concatenative programming |
bak | will move the top value of the stack to the bottom of the stack |
out | will output the active cell's value |
mode | will switch the input/output mode from numbers to ascci and back (default is numbers) |
### | does nothing on its own, serves as a landing point for jumps |
ajp [V] | will jump [V] marks forward, if [V] is negative it will jump backwards. if it reaches the beginning/end of the file, it will wrap around. For example, if [V] is 1, it will jump to the first mark it encounters moving forward. |
ift [V] | if the active cell has a value of [V], it will result true, otherwise false. (does nothing on it's own, is needed for conditional jumps) |
ifm [V] | if the active cell has a mark of [V], it will result true, otherwise false. (does nothing on it's own, is needed for conditional jumps). |
tjp | acts the same as "ajp", but will only jump if the last test performed was true |
fjp | acts the same as "ajp", but only if the last test was false |
end | ends the program when executed (reaching eof will loop the program) |