\
Paradigm(s) | unknown |
---|---|
Designed by | None1 |
Appeared in | 2023 |
Memory system | Cell-based |
Dimensions | one-dimensional |
Computational class | Unknown computational class |
Reference implementation | Original C++ implementation |
Influenced by | !!Fuck |
File extension(s) | .bs |
\ or backslash is a self-modifying esolang created by User:None1, it is originally made to create a cheating quine.
Memory model
It uses a tape unbounded on both sides with cells that can contain slashes or backslashes, the first cells (starting from the origin, which can be any point) are replaced with the program (the program must include only slashes and backslashes), the other cells are all backslashes. It also has a wrapping byte register and a pointer, the pointer is initially at the origin.
Commands
The commands are very complicated.
Command | Meaning |
---|---|
/ | Negate current cell (if it is a slash then convert it to a backslash, vice versa) |
\/ | register=register*2 |
\\/ | register=register*2+1 |
\\\/ | Output register as an ASCII character |
\\\\/ | Input a character and store it into the register (EOF returns 0) |
\\\\\/ | If the register is odd, set current cell to a slash, otherwise a backslash, then let the register bitwise rightshift by 1 |
\\\\\\/ | Move the pointer to the left |
\\\\\\\/ | Move the pointer to the right |
\\\\\\\\/ | If the current cell is a backslash, jump to the start of the program, otherwise set it to a backslash |
\\\\\\\\\/ | Output current cell as a character (slash or backslash) |
\\\\\\\\\\/ | If the current cell is a backslash, terminate the program |
\\\\\\\\\\\/ | If the current cell is a backslash, skip next instruction |
\\\\\\\\\\\\/ | Randomly set current cell to a slash or backslash |
\\\\\\\\\\\\\/ | Jump to the start of program if the pointer is not on the right of program |
(14+n*2) backslashes/ | Set register to n |
(15+n*2) backslashes/ | Subtract register by n |
Commands above are not found | Output Nope. and terminate
|
Note: If the program includes characters other than slashes, backslashes and the undocumented instruction (If you like), it outputs the error message Invalid character
and halts.
Undocumented instruction
Just like the one mentioned in brainfuck, there is one undocumented instruction in \: !
, which separates the program and input.
Examples
Hello World
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\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\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/\\\\\/
The one above is unoptimized, but after he created the interpreter, the author found out that it could be much shorter using the commands \/
and \\/
.
\/\\/\/\/\\/\/\/\/\\\/\/\\/\\/\/\/\\/\/\\/\\\/\/\\/\\/\/\\/\\/\/\/\\\/\/\\/\\/\/\\/\\/\/\/\\\/\/\\/\\/\/\\/\\/\\/\\/\\\/\/\/\\/\/\/\/\/\/\\\/\/\\/\/\\/\/\\/\\/\\/\\\/\/\\/\\/\/\\/\\/\\/\\/\\\/\/\\/\\/\\/\/\/\\/\/\\\/\/\\/\\/\/\\/\\/\/\/\\\/\/\\/\\/\/\/\\/\/\/\\\/
These slashes and backslashes nearly made me go blind XD.
Cat Program (never terminates)
\\\\/\\\/\\\\\\\\/
Nope. interpreter
Alternative
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Cheating quine
\\\\\\\\\/\\\\\\\/\\\\\\\\\\\\\/
Alternative, cheating is debatable
Invalid character
Infinite loop
\\\\\\\\/
Computational class
I don't know the computational class of this language, I know it is definitely not an FSA or a PDA, but I don't know what this is.
External resources
- Original C++ implementation which supports the undocumented instruction.
- \ at GitHub, contains only the original C++ interpreter and the 32bit and 64bit releases of the interpreter as Windows executable.