My first hand at something of this sort.
use Term::ReadKey;@_=GetTerminalSize();$_[2]=$_[0]/40;for( qw(3e7e227e3e 6303630363 7f3e3e7e3f 6360630363 223f227e22) ){local$_=unpack("b*",pack("H*",$_));s/0/ /g;s/1/\#/g;for$ b(1..$_[2]){for(split//){for$c(1..$_[2]){print$_;push@_,$_ ;}}print"\n";push@_,"\n";}}@_=reverse@_;print@_[0..$#_-4];
Run it in differently sized terminals to see why it does so much legwork.

Replies are listed 'Best First'.
Re: A scalable reversing banner
by Your Mother (Archbishop) on Oct 14, 2004 at 05:09 UTC

    That's really cool. Could you, or anyone, dissect it for those of us with high golf handicaps?

      Sure thing. I'll walk through the Deparse output here:
      use Term::ReadKey; @_ = GetTerminalSize(); $_[2] = $_[0] / 40; foreach $_ ('3e7e227e3e', '6303630363', '7f3e3e7e3f', '6360630363', '2 +23f227e22') { local $_ = unpack('b*', pack('H*', $_)); s/0/ /g; s/1/#/g; foreach $b (1 .. $_[2]) { foreach $_ (split(//, $_, 0)) { foreach $c (1 .. $_[2]) { print $_; push @_, $_; } } print "\n"; push @_, "\n"; } } @_ = reverse(@_); print @_[0 .. $#_ - 4];
      What it's basically doing is taking those hex strings and turning them into strings of binary numbers, from there it's replacing all '0's with spaces, and all '1's with '#'s. It then rescales each charachter by a factor of $_2 to make it fit (as best it can) the width of the terminal. The entire time it's scaling and outputting each block it's also pushing the data onto @_, which it then reverses and prints at the end.

      I don't use any variables beyond $_ and @_ by storing values in certain indices in @_.

      I hope that clears it up,
      gkelly