in reply to Re: bigger japh
in thread bigger japh

Very cool. Here's the script I used to generate the constant for the japh, although it's not too much more clear than the japh itself.
#!/usr/bin/perl my $file = <STDIN>; my %chars; $chars{$_}++ for split //, $file; my @set = sort { ord $a <=> ord $b } keys %chars; my $set = quotemeta join "", @set; $file =~ eval "\$file =~ tr($set)(a-z)"; $file =~ s/($_{2,})/$_ . length $1/eg for "a".."z"; print "set=$set (@{[map ord, @set]})\n$file";
Basically, each of the characters used in the japh (pipes and dots and slashes and such) is translated to a letter. Next, for every string of duplicate characters is shortened to the letter and the number of characters it should be expanded to, so "aaaaaa" becomes "a6". There's probably an official name for this technique someplace.

Replies are listed 'Best First'.
Re^3: bigger japh
by demerphq (Chancellor) on Nov 13, 2006 at 13:15 UTC

    There's probably an official name for this technique someplace.

    Run Length Encoding

    ---
    $world=~s/war/peace/g