View Single Post
Old Jul 2nd, 2006, 1:54 AM   #23
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
making a 1337 encryption/decryption progarm is a great excercise for beginning regex.

the following code is unelegant and shitty, and i haven't looked at it for weeks now, but this thread made me think of it. i still haven't tested for the popular "0rz" pluralization, it was just some fun play project that lasted a couple hours.

perl code (to be run from command line)

#!C:\perl\bin\perl -w

$quit = "n";

until($quit eq "y")
{
    print "\n\nenter text...";
    chomp($input = lc(<STDIN>));

    $input=~tr/abcefgijlopqrstyz/46<3fg|j10pqr57yz/;
    $input=~s/d/|)/;
    $input=~s/h/|-|/;
    $input=~s/k/|</;
    $input=~s/m/|\\\/|/;
    $input=~s/n/|\\|/;
    $input=~s/u/\\\//;
    $input=~s/v/\\\//;
    $input=~s/w/\\\/\\\//;
    $input=~s/x/></;

    print $input;
    print "\n\nwanna quit? (y or n)";
    chomp($quit = lc(<STDIN>));
}

print "\n\nthanks for nothing, don't come back...BITCH!!!";

yeah, and 1337 is teh sux0rz n00b! pwned!!!!!!!111ONE
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote