Brainfuck interpreter applet

Brainfuck is a small programming language with 8 legal operations, each represented by one character. The programmer has access to one single pointer and a memory buffer. The pointer can be moved forwards or backwards in the memory buffer, one step at the time (using '>' and '<'). The value wich the pointer points to can be increased or decreased by one (using '+' and '-'). Brainfuck does also offer branches using square brackets ('[' and ']') as a kind of loop construct. The two remaining operations are input (',') and output ('.'), that stores or displays the byte at the current pointer position.

Brainfuck operations

The interpreter


You should write your program (or copy one of the sample programs) into the upper text area. Press the "Run" button and the output will be written in the lower text area. The applet offers 8 kB of memory and that's more than most brainfuck applications need.

Sample programs

hello world

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

0123456789

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

echo

>+[>,.----------]<[<]>[>++++++++++.----------]

notepad

+[,.]

double notepad

+[,..]

character print loop

+[.+]