This is an interpreter for the (in)famous, but turing-complete, Brainf*ck programming language.
Update 200112161916+0100: s/f.ck/f*ck/g
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 | |
by Juerd (Abbot) on May 09, 2002 at 14:33 UTC | |
by mtve (Deacon) on May 10, 2002 at 16:06 UTC | |
by Juerd (Abbot) on May 10, 2002 at 21:50 UTC | |
by mtve (Deacon) on May 11, 2002 at 16:13 UTC |
Back to
Cool Uses for Perl