in reply to Brainf*ck interpreter

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

Replies are listed 'Best First'.
Re: Re: Brainf*ck interpreter
by Juerd (Abbot) on May 09, 2002 at 14:33 UTC

    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?

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

        Noop isn't quite nothing :) But it isn't really clear in the specs.

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

        No, as I disclaim copyright. It was a foolish mistake of me to put (c) there, as I intended to make it public domain (as most of my scripts). I guess I just did it because of the three characters...
        Besides, your interpreter has probably been coded from scratch, so I deserve no credit.

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