in reply to Geek Creedo JAPH
Pretty nice. Not terrifically obfuscated, except for the middle bit where you do something kinda backwards. That caught me for a sec until I realized what was actually happening. Deconstruction follows (spoiler).
while (<DATA>) { s/\r?\n?//g; # remove newlines $a.=$_; } # $a now contains the whole of DATA in one line for (split(/;/,$a)) { # split into groups $b=0; for ( split (/,/) ) { # split into singles if (!$b++) { # first letter # Store the first number of the # group as a letter $c = chr ( b($_) ); } else { # And scatter it wherever it needs # to appear in the mystery string @d[b($_)] = $c; } } } print @d; sub b { # convert from binary to decimal (littleendian) $a=$b=0; for(split(//,reverse$_[0])) { if($_) { $a+=2**$b; } $b++; } return $a; } #"The unwritten geek credo states that originality and strangeness are #good, and that blind conformity and stupidity are unforgivable." # http://samsara.circus.com/~omni/geek.html __END__ 0100000,0000100,0001100,0010001;1100001,0000101,0010011;1100011,001010 0;1100101,0001010,0001110,0010110;1101000,0001001,0010010;1101010,0000 000;1101011,0010101;1101100,0010000;1101110,0000110;1101111,0000111;11 10000,0001101;1110010,0001011,0001111,0010111;1110011,0000010;1110100, 0000011,0001000;1110101,0000001;
So, for instance, the first group of numbers is 32, 4, 12, 17. Thus a space (chr(32)) appears at positions 4, 12, and 17. I was a little disappointed that you didn't capitalize J or P, and that you didn't put a newline at the end. I'm always a little more impressed when little details like that are covered.
LAI
__END__
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Deconstruction: Geek Creedo JAPH
by cciulla (Friar) on Apr 24, 2003 at 15:31 UTC | |
by LAI (Hermit) on Apr 24, 2003 at 16:39 UTC | |
by Anonymous Monk on Apr 25, 2003 at 10:41 UTC |