line
Designed by | Relt |
---|---|
Appeared in | 2021 |
Memory system | Cell based |
Dimensions | Two dimensional |
Computational class | Turing complete |
Reference implementation | Unimplemented |
File extension(s) | currently none |
Line is a 2d cell-based programming language that is structured on lines and turns.
Syntax
Program flow
A line is a path that the Cursor follows every step 1 grid unit forward.
1 | 2 | 3 | 4 | 5 |
---|---|---|---|---|
The cursor will turn along with the line
1 | 2 | 3 | 4 |
---|---|---|---|
The cursor will merge into another line with this type of intersection
Both of these situations will end up with the cursor moving up
Instructions
Tape operations
The cursor has its own memory tape (like in Brainfuck)
+ and - equivalents are
going through this diagonal line will increment the selected cell | |
and going through this diagonal line with decrement it |
The cursor detects what type of curve its going through, and will act accordingly
These instructions work in every 4 directions, meaning that all of these:
will increment the selected cell
Both instructions can run multiple times in a row like this:
Every step, the current cell will get incremented. The brainfuck equivalent of this is +++ |
Moving along the tape can be done with these curves
> | |
---|---|
When the cursor detects that it has gone through a curve like this, it will move the pointer to the right |
< | |
---|---|
When the cursor detects that it has gone through a curve like this, it will move the pointer to the left |
Conditional turn
When the cursor encounters this type of curve, it will turn right if the current cell is 0, otherwise, it will turn left. |
User input
When the cursor encounters this type of curve, it will ask the user for a number | |
When the cursor encounters this type of curve, it will print the current cell as a number |
Brainfuck compatibility
While this language is 100% brainfuck compatible, it also offers features that come from the way its structured, like making unconditional jumps to other parts of the code.