Brainfuck 2.0

From Esolang
Jump to navigation Jump to search

Brainfuck 2.0 is designed by PSTF, it is based on EA Script, It's in the code. but it didn't costs anything.

Instructions

All commands work on a 30,000-bit tape, a stack, and a counter.

Basics

Instruction Meaning
< Moves the pointer one cell to the left.
> Moves the pointer one cell to the right.
+ Adds 1 to the pointed cell.
- Subtracts 1 to the pointed cell.
. Prints the pointed cell as a character.
, Reads a character from input and stores it into the current cell.
[ If the current cell data is 0, jump to the corresponding closing bracket.
] If the current cell data isN'T 0, jump to the corresponding opening bracket.
{ Pushes the pointed cell's value to the stack.
} Pops from the stack into the current cell.
* Doubles the pointed cell's value.
` Halves the pointed cell's value.
~ Bitwise NOTs the pointed cell's value.
^ Squares the pointed cell's value.
@ Break out of loop.
! Loop continue.
? Set the pointed cell to a random 32-bit value.
#00000000 - #FFFFFFFF Sets the pointed cell to a byte, written in hexadecimal.
' Sets the pointed cell to the value of the next character.
" String mode. Set the pointed cell to the value of each character, then move right.
_ Unary minus. Set pointed cell to (256-last pointed cell value)%256.
:foo: Define a function. Its name is between the colons.
$ End function definition.
;foo; Run a function. Its name is between the semicolons.
/ Loop modifier. Checks if pointed cell is positive (as a signed value) instead of nonzero.
\ Loop modifier. Checks if pointed cell is negative (as a signed value) instead of nonzero.
q Print the program's source code.

Advanced

Instruction What it does
+0000000 - +FFFFFFF Add a value to the pointed cell.
-0000000 - -FFFFFFF Subtract a value from the pointed cell.
*0000000 - *FFFFFFF Multiply.
`0000001 - `FFFFFFF Divide.
^0000000 - ^FFFFFFF Exponentiate.
%0000001 - %FFFFFFF Modulo.
&0000000 - &FFFFFFF Bitwise AND.
|0000000 - |FFFFFFF Bitwise OR.
X0000000 - XFF Bitwise XOR.
O Print the pointed cell's value as eight hexadecimal digits.
I Input eight hexadecimal digits into the pointed cell's value.

More advanced

Instruction What it does
d Change everything to decimal(arbitary length).
b Change everything to binary.
o Change everything to octal.
h Change everything to hexadecimal back again.
s Change everything to base 64.
T Change everything to 8-bit.
M Change everything to 16-bit.
L Change everything to 64-bit.
§ Change everything to 32-bit.
S Return and discard stack top value.

Examples

Add by yourself, I'm too lazy to write them.

Computational Class

It is Turing-complete, since Brainfuck with command price is Turing-complete only if you want to pay money, and this is free version of Brainfuck with command price. You could also call this "THE BLACK FRIDAY" or "Double eleven".

See also

Categories and References