↑110010000100110110010
- Not to be confused with ↓110010000100110110010.
↑110010000100110110010 is an esolang by User:PythonshellDebugwindow.
Memory
↑110010000100110110010 uses data (initialized to an right-unbounded infinite tape of zeros), a data pointer (initialized to 0), a command pointer (initialized to nil), and a jump offset (initialized to 0), all of which are unbounded signed integers (or, in the data's case, a right-unbounded tape of them).
Commands
The command is on the left, and the value of the command pointer is on the top.
Nil | 0 | 1 | 2 | Anything else | |
---|---|---|---|---|---|
↑
|
Increment the data pointer | Increment the data pointed to by the data pointer | Increment the jump offset | Increment the command pointer | Set the command pointer to 2 |
↓
|
Decrement the data pointer | Decrement the data pointed to by the data pointer | Decrement the jump offset | Decrement the command pointer | Input an integer to the data pointed to by the data pointer |
0
|
Set the data pointer to 0 | Set the data pointed to by the data pointer to 0 | Set the jump offset to 0 | Set the command pointer to 0 | Jump backwards the number of times specified by the jump offset |
1
|
Set the data pointer to 1 | Set the data pointed to by the data pointer to 1 | Set the jump offset to 1 | Set the command pointer to 1 | Jump forwards the number of times specified by the jump offset |
↕
|
Set the command pointer to 0 | Print the data pointer, then set the command pointer to 2 | Print the data pointed to by the data pointer | Print the jump offset, then double the jump offset | Print the command pointer |
↨
|
Set the command pointer to 3 | Skip the next command if the data pointed to by the data pointer is not 0 | Set the command pointer to nil | Skip the next command if the data pointer is not 0 | Set the command pointer to nil |
Programming in this language takes a lot of trial and error, and sometimes simple effects can take 3 commands. Due to the command pointer, and the sometimes not-so-obvious ways to change it as desired, you have to go through the whole program character-by-character to find out what any one character does.
Undefined behaviour
It's undefined behaviour when the data pointer goes negative, or when a jump goes out-of-bounds.
Snippets
To set the command pointer to 1 if it's at nil:
↨↑↓
Examples
One-time cat program
↨↓↑↓↕
XKCD Random Number
↑↑↑↑↕↕
Computational class
↑110010000100110110010 can be proven Turing-complete via reduction from brainfuck.
Programs start and end with ↨
to initialize the program and avoid undefined behavior respectively.
BF | ↑110010000100110110010 |
---|---|
> |
↨↑↨
|
< |
↨↓↨
|
+ |
↑0↑↕↑
|
- |
↑0↓↕↑
|
. |
↑1↕↨↨
|
, |
↓
|
[ |
↑11↨↨↑[jump offset A]0↨↕↑↕1↨↕↓↕↑
|
] |
↑11↨↨↑[jump offset B]↑0
|
To calculate the jump offset for each jump, use the following formulas:
and
where is the number of translated commands within the loop
The jump offsets can then be converted into commands by converting the numbers from decimal to binary, removing the first digit, and then converting the digits to ↕↑↕↕↕↑
(0) or ↕1↑↨↨↑
(1).
Example:
55 -> 110111 -> 10111 -> ↕1↑↨↨↑ ↕↑↕↕↕↑ ↕1↑↨↨↑ ↕1↑↨↨↑ ↕1↑↨↨↑
95 -> 1011111 -> 011111 -> ↑↕↕↕↑↕ 1↑↨↨↑↕ 1↑↨↨↑↕ 1↑↨↨↑↕ 1↑↨↨↑↕ 1↑↨↨↑↑
External resources
- An interpreter on GitHub