# I interpolated the numerical constants built from $[, $|, $m,
# which have the values 0, 1, 4 resp.
# By indenting the code and changing ?:, map, etc to proper
# loops and ifs, and also doing some other minor changes, we get this.
$|= 1;
$m= -1;
while ($line=<DATA>) {
if ( $line=~m;\S;s )
{ ++$m }
else {
# $m is always 4 at this point
for $n (@s, -64) { # loop A
print chr ( $n +96 -($n!=16 ? 0 : 32) )
}
@s= ();
$m= -1;
}
$g= 0;
while ($line=~m/(....)/g) { # loop B
$1=~m/;/ and $s[$g]+= 1<<$m;
$g++;
}
}
# The code reads the DATA section in, and splits every line
# to four-char long parts. Nothing counts, only whether
# those parts have a semicolon or not. I've actually changed all
# other glyphs to #'s, as `'.,: is all the same for the script.
#
# The obfu processes each paragraph at once. For each line
# of the paragraph, loop B runs once. While it runs, $m is
# the line number in the paragraph minus one. As you can see,
# the loop sets bit $m of $s[$g] iff the $m+1'th line of the
# $g'th big letter has a semicolon.
#
# Then, at the end of each paragraph (ie line of big letters),
# loop A runs. At then, the data from each big letter is stored
# in @s, one letter each, so the loop is looping in the big letters.
# And wow, it turns out, that the code just prints chr(96+$n), the
# $n'th letter of the alphabet. (subtracting 32 for P to make it a
# capital). At the end, it prints a space too, which it gets from
# the number -64 (really encoded as -($m<<$m-$|)-($|<<$m+$|) ).
#
# So, in fact, each big letter in the DATA section just
# encodes itself, the code is in fact doing some kind of OCR.
#
# Example of the encoding:
#
# E R
# ;## 1 ###
# # # ; 2
# ;# 4 ###
# # # #
# ### ; # 16 +
# ----------------
# 5 18
#
# And indeed, E is the 5th letter of the alphabet,
# R is the 16th.
#
__DATA__
### # ; #;# ###
; # # ; #
# # ; ### ;
; # # # #
## #;# #;# ;
#;# ### #;# ### # # ;#; ###
# # ; ; ; ; # # # # # ;
### # ; # ; ; ### #; ###
# # ; ; # ; # # ; # # #
# # # # ### ; # # ### # ;
### ##; ### #
# # # ; # #
## #; ### ;
# # # # ;
; ### ; ; ###
# # #;# #;# ; # ;## ###
# # # # ; # ; # # ;
### ### # ### ;# ###
; # # # # ; # # # #
# # # # ### # # ### ; #
__END__
Update: Corrected DATA section. |