Melly++, even though it's system-dependent, for a very clever, if not unique strategy.

Here's a version which works for Perl version 5.8.0 i386-linux-thread-multi:

@i='058233660927207121220869229603962185544803008278'=~/.{8}/g; map{srand$i[$_];map{print chr(32+int(rand 59))}1..4}0..5;

And here is a program which finds the required seeds for whatever O/S one is currently using:

use strict; use warnings; my $b_show_almost = 1; # Show string which "almost" match? map { find_string($_) } ('JUST', ' ANO', 'THER', ' PER', 'L HA', 'CKER +'); sub find_string { my ($string) = @_; my $display = substr($string, 0, 3); # Indication of progress my $seed = 0; # Try all seed values my $result; # Result of rnd generation while (1) { $result = ""; srand $seed; map { $result .= sprintf "%s", chr(32 + int(rand 59))} (1..4); if ($result =~ /^$display/) { if ($result eq $string) { printf "Seed %08.8s => '$result' ** Success **\n", $s +eed; return; } if ($b_show_almost) { printf "Seed %08.8s => '$result'\n", $seed; } } ++$seed; } }

Update:  Changed "unique" to "clever", after ambrus' observation below.  Actually, his reference alludes to an even earlier version with a similar concept.  Just goes to show that great minds think alike!


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

In reply to Re: JAPH - more obscure than obfuscated... by liverpole
in thread JAPH - more obscure than obfuscated... by Melly

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.