Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

bigger is better

by iamcal (Friar)
on May 29, 2003 at 12:37 UTC ( [id://261538]=obfuscated: print w/replies, xml ) Need Help??

not as confusing as it could be, but still a little difficult to guess what's going on
#!/usr/bin/perl -w use strict; $_="Just another Perl hacker"; my@x=(65,14,17,31,17,17,74,31,4,4,4,24,85,17,17,17, 17,14,83,15,16,14,1,30,84,31,4,4,4,4,78,17,25,21,19 ,17,79,14,17,17,17,14,72,17,17,31,17,17,69,31,16,30 ,16,31,82,30,17,30,18,17,80,30,17,30,16,16,76,16,16 ,16,16,31,67,14,17,16,17,14,75,17,18,28,18,17);my%x ;while (my$x=shift@x) {$x{chr($x)}=[shift@x,shift@x, shift @x,shift @x,shift @x];}sub c{my @e=split//,uc( shift);my@ee;for(@e){my@ret=&a($_);$ee[$_].=$ret[$_] for 0..4;}print join("\n",@ee)."\n\n";}sub a{my@d;my ($e)=@_;push@d,b($e,$_)for(@{$x{$e}});return@d;} sub b{my($f,$e,$d)=@_;for(0..4){if($e>(2**(4- $_))-1){$e -=(2**(4-$_));$d.=$f;}else{$d.=' ';}};return$d.' ';} c($_)for split/\s/;

Replies are listed 'Best First'.
Re: bigger is better (deobfuscated)
by Aristotle (Chancellor) on May 31, 2003 at 12:37 UTC

    (Precalculations done and removed from the code; functions assimilated to where they're used; variables renamed.)

    #!/usr/bin/perl -w use strict; $_ = "Just another Perl hacker"; my %bitmap = ( A => [ 0b01110, 0b10001, 0b11111, 0b10001, 0b10001, ], C => [ 0b01110, 0b10001, 0b10000, 0b10001, 0b01110, ], E => [ 0b11111, 0b10000, 0b11110, 0b10000, 0b11111, ], H => [ 0b10001, 0b10001, 0b11111, 0b10001, 0b10001, ], J => [ 0b11111, 0b00100, 0b00100, 0b00100, 0b11000, ], K => [ 0b10001, 0b10010, 0b11100, 0b10010, 0b10001, ], L => [ 0b10000, 0b10000, 0b10000, 0b10000, 0b11111, ], N => [ 0b10001, 0b11001, 0b10101, 0b10011, 0b10001, ], O => [ 0b01110, 0b10001, 0b10001, 0b10001, 0b01110, ], P => [ 0b11110, 0b10001, 0b11110, 0b10000, 0b10000, ], R => [ 0b11110, 0b10001, 0b11110, 0b10010, 0b10001, ], S => [ 0b01111, 0b10000, 0b01110, 0b00001, 0b11110, ], T => [ 0b11111, 0b00100, 0b00100, 0b00100, 0b00100, ], U => [ 0b10001, 0b10001, 0b10001, 0b10001, 0b01110, ], ); for (split /\s/, uc) { my @ee; for my $char (/./g) { my @rastered = map { my $bitrow = $_; my $pixrow; for (16, 8, 4, 2, 1) { if ($bitrow > $_ - 1) { $bitrow -= $_; $pixrow .= $char; } else { $pixrow .= ' '; } } $pixrow . ' '; } @{ $bitmap{$char} }; $ee[$_] .= $rastered[$_] for 0 .. 4; } print join ("\n", @ee) . "\n\n"; }
    Not very obfuscated per se; the translation was mostly straightforward, mechanical work.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://261538]
Approved by Tanalis
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2025-06-21 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.