in reply to Slow JAPH

Here is the code that I used to find my message in pi:
$pi = "314159265358979323..."; $base = -65; $offset = 0; while ($offset < (100 - (ord('_')-65))) { print "Offset $offset "; $find = "JUST_ANOTHER_PI_HACKER"; $index = 0; while ($find ne "") { $fnum = sprintf("%2.2d",ord(substr($find,0,1))+$base+$offset); substr($find,0,1) = ""; $found = index($pi, $fnum, $index+2); print "FAILED" if $found < 0; $found -= $index; $index += $found; print "$found "; } print "\n"; ++$offset; }
You will have to find yourself a suitable source of pi digits, I recommend either the algorithm that I borrowed, or Project Gutenberg (zip). Figure on 100 digits per letter, then sum the offsets produced to find out how many digits are actually used.

I chose to limit it to upper case letters and underscores as spaces, but that can be fixed. It scans a range of offsets so you can choose the shortest list of positions, then calculate the offset to recreate the original message. In the instance provided, it just happens that an offset of 1 results in +64 in the recreation code, which is actually rather disappointing because it looks like I didn't make the effort to optimise the offset list! If I had done "JUST_ANOTHER_PERL_HACKER" that would have resulted in offset 29, giving +36 instead of +64 in the final code, and I could have asked "For bonus ++, why is the +36 value there?"