Mindcrush

From Esolang
Jump to navigation Jump to search

Mindcrush is a Brainfuck derivative created by IAmAPersson in 2013 and implemented in SmileBASIC for Petit Computer. It can be downloaded (sort of) on its page at the Petit Computer Wikia.

Language Definition

Mindcrush has 9 commands:

Command Meaning
+ Increase the number in selected cell by one
- Decrease the number in selected cell by one
> Increase the pointer
< Decrease the pointer
[ Marker for ]
] Jump to the matching [
& Returns a result of the status of cell1
/ Output cell; if cell in empty, get input
. Used as a marker in the case of a program error2

1If the selected cell is zero, jump to the nearest dot (.) AKA return an error. You can add +s or -s after the & to define a number. For example, &++ means "If the selected cell is two, jump to the nearest dot."

2If an error occurs in the program (like trying to go to cell -1 or cell 32,001) then the program will jump to the nearest dot (.) and continue to execute the program.

Each cell, when output, will display a specific character. Below is a list of characters (it does not operate on ASCII):

  Z   Y   X   W   V   U   T   S   R   Q   P   O   N   M   L   K   J   I   H    
-27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10  -9  

 G   F   E   D   C   B   A  newline input  1  2  3  4  5  6  ...
-8  -7  -6  -5  -4  -3  -2    -1      0    1  2  3  4  5  6  ...

Program examples

The obligatory Hello World example:

------>------------->------------------------>-<<<+++/---/>//---/>/</---/<++++++/[>].-----/[]

CAT program:

[/&+ ->].[<].[/>].[]