A brainfuck interpreter in PHP

Nono, no dirty talking here; just reproducing naming excrescence in technology. Brainfuck [1] is a turing-complete programming language written by Urban Müller around 1993 [2]. The cool thing about it is its size; the initial compiler was only 240 Bytes in size.

Short: 240 byte compiler. Fun, with src. OS 2.0
Type: dev/lang
Uploader: umueller@amiga.physik.unizh.ch

The brainfuck compiler knows the following instructions:

Cmd Effect
--- ------
+ Increases element under pointer
- Decrases element under pointer
> Increases pointer
< Decreases pointer
[ Starts loop, flag under pointer
] Indicates end of loop
. Outputs ASCII code under pointer
, Reads char and stores ASCII under ptr

Who can program anything useful with it? :)

There is a PHP interpreter for Brainfuck available now [3]. Just play around!

Some more background on BF and Turing is available [4].

[1] http://aminet.net/dev/lang/brainfuck-2.readme
[2] http://wuarchive.wustl.edu/~umueller/
[3] http://daniel.lorch.cc/projects/brainfuck/
[4] http://koeln.ccc.de/projekte/brainfuck/

Leave a Reply