As a sidenote, i'm only using 7 of the 8 available instructions, though the interpreter can also handle the eighth. Can anyone spot what it is...#!/usr/bin/perl -w use strict; my($p,@m);@_=('>+++++++++[<++++++++>-]<++.>++++++[<++++++++>-]<-----.- +-.+.>++++++++[<---------->-]<----.>+++++++++[<+++++++>-]<++.>++++[<++ ++>-]<+.+.+++++.>++++[<--->-]<.---.>++++[<+++>-]<+.[-]>++++++++[<++++> +-]<.>+++++++[<+++++++>-]<-.>+++++++[<+++>-]<.+++++++++++++.------.[-] +>++++++[<++++++>-]<----.>++++++[<+++++++>-]<--.>++++++[<++++>-]<+.++. +++++++++.>++[<--->-]<.+++++++++++++.[-]++++++++++.');*$=sub{s/./$&;\n +/g;s/\+|-/P$&$&/g;s/</\$p--/g;s/>/\$p++/g;s/\./print chr P/g;s/,/P=or +d getc/g;y/[]/{}/;s/{;/while(P){/g;s/};/}/g;s/P/\$m[\$p]/g;eval;print +$@if$@};&$ for@_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Interpreted
by japhy (Canon) on Apr 19, 2001 at 21:42 UTC | |
by iamcal (Friar) on Apr 20, 2001 at 14:02 UTC | |
|
Re: Interpreted
by japhy (Canon) on Apr 19, 2001 at 21:30 UTC | |
by iamcal (Friar) on Apr 19, 2001 at 21:34 UTC | |
|
Re: Interpreted
by Anonymous Monk on Apr 23, 2001 at 21:55 UTC | |
by iamcal (Friar) on Apr 24, 2001 at 12:14 UTC | |
by xtrem (Novice) on Apr 24, 2001 at 19:21 UTC | |
by iamcal (Friar) on Apr 24, 2001 at 20:01 UTC |