|
2L (the Two Language) is an esoteric programming language derived loosely from the PATH programming language and Brainfuck. An esoteric programming language is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke, and not with the intention of being adopted for real-world programming. ...
PATH is an esoteric programming language derived from the Brainfuck language. ...
Jump to: navigation, search brainfuck is a computer programming language noted for its extreme minimalism. ...
Like PATH and Befunge, it's two-dimensional. Like BrainFuck, it operates on a tape. However, it only has two symbols. It manages this by overloading the * symbol by direction. The data pointer starts at location 2, not 0 as in BrainFuck, because 0 and 1 are significant. The tape is filled with 0s, as in BF. The program pointer starts at 0,0 moving right, and ends when the program pointer goes below 0 left or up. Befunge is a stack-based, reflective, esoteric programming language. ...
Symbols
| SYMBOL | FUNCTION | | * | All IO and tape operations. This operation has a different function for all four cardinal directions: Up: Move the data pointer to the right (> in BF) Down: Move the data pointer to the left (< in BF) Left: Decrement the value at the data pointer (- in BF) Right: Increment the value at the data pointer (+ in BF) | | + | if the value the data pointer points to is nonzero, turn right, otherwise turn left | I/O Tape locations 0 and 1 (TL0, TL1) are significant. 1 doesn't actually hold a value, it merely causes an I/O operation if you attempt to increment or decrement it. If the value at TL0 is 0, and you attempt to change the value of TL1, a character will be read from input into TL0. If TL0 is not 0, and you attempt to change the value of TL1, a character will be outputted from the value of TL0.
Example Because of the extreme level of overloading, even the simplest program is incredibly complex in 2L. Here's a simple loop, that produces the value 9 by multiplying 5 by 2 then subtracting 1: ** + + * *****+ + + * + * + * + + Links |