in reply to Re: bigger japh
in thread bigger japh
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.#!/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";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: bigger japh
by demerphq (Chancellor) on Nov 13, 2006 at 13:15 UTC |