BrainCrash

From Esolang
Jump to navigation Jump to search
Not to be confused with Braincrash, invented by User:TehZ.

BrainCrash is a Brainfuck derivative language designed by ぬこ, published in 2008. The purpose of the language is to make a "Hello, world!" program with zero-byte file.

Features

In addition to original 8 instructions, this language has 4 bitwise logical operation instructions and a special behaviour, which is executed when the program begins and ends.

Extended Instructions

Instructions Descriptions
| OR operation: Performs a bitwise OR operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer. The pointer gets incremented.
& AND operation: Performs a bitwise AND operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer. The pointer gets incremented.
~ NOT operation: Performs a bitwise NOT operation on the byte at the pointer.
^ XOR operation: Performs a bitwise XOR operation on the byte at the pointer and the byte in storage, storing its result in the byte at the pointer. The pointer gets incremented.

Special Behaviours

  • The first 13 memory cells are initialized with 72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, and 33 ("Hello, world!" in ASCII, without LF-termination) respectively. In other words, the following code is inserted to your beginning of program:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++>
<<<<<<<<<<<<<
  • When the program ends, the pointer keeps being incremented until the value at the pointer is zero, outputting the currently pointed-to value. In other words, the interpreter automatically appends [.>] to your program.

Examples

File
(empty)
Output
Hello, world!
File
|
Output
mllo, world!

External resources

Other implementations