http://qs321.pair.com?node_id=89827

Ever wanted to hang out with all your budz on #warez, but haven't yet mastered their way of typing? Don't fret! This snippet of obfuscated code will convert anything from STDIN to l33t speak!

For example:
"Hey! What's up, you guys? This IRC channel rocks!"
becomes:
"HEy!11!1!!!!!1!!!! whaTZZZZZ Up Jo0 GUyzzZ?!!?!!?!?? ThIZzZz IRC ChAnNEL rOxORzZzZZz!!!111!1"
while(<STDIN>){$_=lc($_);s/ou/oo/g;s/yo/jo/g;s/ck(s|\W)/xor$1/g;s/elit +e/leet/g;s/[\,\']//g;while(/[\?][\?\.\!]*/){my $ex=xp("Q","E");s/[\?] +[\?\.\!]*/$ex/;}while(/[\.\!]+/){my $ex=xp("E","1");s/[\.\!]+/$ex/;}s +/Q/\?/g;s/E/\!/g;while(/s([\W])/){my $ex="z" x int(rand(6)+1);s/s([\W +])/$ex$1/;}my $o;while (s/^(.)//s){my $c=$1;if(rand(1)>.5){$c=uc($c); +}else{$c=lc($c);}if(rand(1)>.5){$c=~tr/iseto/15370/;}$o.=$c;}print $o +;}sub xp{my ($a,$b)=@_;my $o=$a;my $len=int(rand(10)+5);for(my $x=0;$ +x<$len;$x++) {if(rand(1)>.4){$o.=$a;}else{$o.=$b;}}return $o;}

--
I write the code while the master is away!

Replies are listed 'Best First'.
Re: Useful obfuscation for chatting
by Masem (Monsignor) on Jun 20, 2001 at 01:58 UTC
    -joke-

    So, when are we going to get a Torgo-speak obfu translator? eg:

    All your base are belong to us
    becomes
    aLl yOUr BasE aRE BeLonG tO Us
    -end joke- :-)


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

      Ta dah!

      @tr=qw(A-Za-z a-zA-Z);while(<STDIN>){eval"y/$tr[0]/$tr[rand(2)]/"& print for split''}
Re: Useful obfuscation for chatting
by Beatnik (Parson) on Jun 20, 2001 at 17:58 UTC
    I'm sticking with the less obfuscated Text::Bastardize's k3wlt0k :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.