#!/usr/bin/perl -- -*- cperl -*- $%=pop||$=/5;$|=1;sub ::{if(@_){my@b=map{my$a=ord(shift)-32;join'',map {($a&(2**$_))?'#':' '}0..5}1..5;my%x=(n,::(@_),b,[@b]);push@x,\%x;\%x} else{$x[0]}}$x=::(split//,'@@@B<<BBB<BFJRB<B^BB.2B2.<B^BB.2>B><ZJZ<.2' .'>B>>B>2B^(((^<"ZB<BB^BB^(((( (BFJRB^"."^^(((( ');$s=$j=$x;$_= "10 PRINT EMAIL\$\n20 GOTO 10\n";while($"){@==();$d=$s=$$s{n};for(1.. $%){@b=@{$$d{b}};$d=$$d{n}||=$j;my$k;for(@b){$=[$k++].=$_;}}select$f,$ f,$f,&_/5;}sub _{print join $/,@=,$/}eval while(s/(.*?)\n(.*)/$2\n$1/)

Replies are listed 'Best First'.
Re: Remember doing this in BASIC?
by Roger (Parson) on Nov 19, 2003 at 00:37 UTC
    WOW! Excellent stuff. This surely brings back a lot of memory from my early BASIC days.

    Here's a tribute to the ever lasting memory of GW-BASIC.

    I wrote the following code a while back. It is no where near obfuscated, but it was fun to write.

    #!/usr/local/bin/perl -w while(<DATA>){chomp,m/^(\d+)\s+(.*)/,$p[$1]=$2} {redo if ($p[++$pc] eq undef); if($p[$pc]=~ /^(?:\s)*FOR\s+(\w+)(?:\s)*=(?:\s)*(\d+)(?:\s)*TO(?:\s)*(\d+)/x ){$var{$1}=[$pc,$2,$3];}elsif($p[$pc]=~/^(?:\s)*PRINT\s+'(.*)'/x ){print "$1\n";}elsif($p[$pc]=~/^(?:\s)*NEXT\s+(\w+)/x){die "variable $1 not defined!" if !$var{$1};$var{$1}->[1]++;$pc=$var {$1}->[0] if $var{$1}->[1]<=$var{$1}->[2];}elsif($p[$pc]=~ /^(?:\s)*END/x){exit}redo} __DATA__ 10 REM ****** BASIC PROGRAM ******* 20 30 FOR I = 1 TO 5 40 FOR J = 1 TO 5 50 PRINT 'I LOVE GW-BASIC!' 60 NEXT J 70 NEXT I 80 90 END
Re: Remember doing this in BASIC?
by Coruscate (Sexton) on Nov 18, 2003 at 19:33 UTC
    Immediately after while($"){, insert a system "cls"; or system "clear"; (depending on your OS) to get one scrolling line.
Re: Remember doing this in BASIC?
by jdtoronto (Prior) on Nov 18, 2003 at 18:20 UTC
    no, but I remember doing such stuff in PICK. OK, they called tha language PICK-BASIC.

    jdtoronto