http://www.perlmonks.org?node_id=132368

This is an interpreter for the (in)famous, but turing-complete, Brainf*ck programming language.
Update 200112161916+0100: s/f.ck/f*ck/g

#!/usr/bin/perl -s # |bf; bf $file; bf -e=, $|++;undef$/;$_=$e||<>;tr/-+,.[]<>//cd;for$ a(qw%]} [while($p[$p]){ -$p[$p]-- +$p[$p]++ ,$p[$p]=ord(getc) .print(chr($p[$p])) <$p-- >$p++%){s/\Q${\substr$a,0,1}/${\substr$a,1} ;/g}eval; # by Juerd <juerd@juerd.nl>, 2001

2;0 juerd@ouranos:~$ ./bf -e='++++++++[>++++++++<-]+++++[>>+++++<<-]>> ++ [<+.>-]++++++++++.' ABCDEFGHIJKLMNOPQRSTUVWXYZ

Replies are listed 'Best First'.
Re: Brainf*ck interpreter
by mtve (Deacon) on May 09, 2002 at 13:34 UTC

    Can't stop after last perlgolf.

    #!/usr/bin/perl -s # |bf; bf $file; bf -e=; $|++;$/=$a;$_=$e||<>;%a=qw%[ while($p[$p]){ , $p[$p]=ord(getc) . print+chr$p[$p] < $p-- > $p++ + $p[$p]++ - $p[$p]-- ] }%;s/./$a{$& };/g;eval

    "Please shoot me" (C) Jay Tilton

    Update on August 10, 2002: another 14 bytes

    #!/usr/bin/perl -s # |bf; bf $file; bf -e=; $_=($/=$e)||<>;$p=w;%a=qw%[ while($$p){ ] } . print+chr$ , $$p=ord(getc); + ++$ - --$ < chop > $p=w.%;$|=s/./$a{$&}\$p;/g;eval

    Update on May 19, 2004: Rick Klement's wonderful solution to PCLP#2.5 Polish golf

    $_.=qw(++ }while$ -- ++$ $$p=shift; --$ print$ ${)[$p%60%8].'$p+0;'while$p=ord getc;eval

      Brainfuck interpreters must discard unknown characters. Yours doesn't.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.
      

        I think it does - unknown chars are replaced with noop ';'

        Dear Juerd, can I put "(C) Juerd & Mtve" on it?