GnuVince
05-25-2002, 09:21 PM
Hi all,
your friends (well, we hope so) inkedmn and GnuVince have a new
challenge for all l33t h4x0rzzz of CoderForums.net. Your new challenge,
should you decide to accept it, will be to program a basic english to
l33t sp33ch translator. We made a table so that all outputs are
hopefully the same.
For lowercase characters:
@ b c d 3 p|-| g H | j k l m n () p q r $ 7 u v w x y z
For uppercase characters:
4 B C D 3 ph G }{ 1 J K L M N 0 P Q R 5 7 U V W X Y Z
The goal of this talent is neither to have the fastest code, nor to have
the shortest program: the real goal is to prove your total l33tness!
Also, you must have your mother's permission to participate if you are
not 18 years old or older.
Good luck all, may t3h l33tness be with you
Vince and Brett
P.S: Your program should translate user input, not a file.
[Edit] If your code is long due to the translation tables, could you attach it to keep the thread short? thank you
[Edit2] Modified my program
iDxMan
05-25-2002, 09:38 PM
The force luke.. the.. uh.
#!/usr/bin/perl
%tbl = qw (
a @
e 3
f p|-|
h H
i |
o ()
s $
t 7
A 4
E 3
F ph
H }{
I 1
O 0
S 5
T 7
);
print "Enter some text: ";
chomp($input = <STDIN>);
print "\nInput : $input\n";
print "Your l33t h4x0rzz output: ";
foreach $c (split(//, $input)) {
$c = $tbl{$c} if (defined($tbl{$c}));
print $c;
}
print "\n";
Input : i like to go to the store
Your l33t h4x0rzz output: | l|k3 7() g() 7() 7H3 $7()r3
... why I didn't put everything in the quote for tbl the first time, I dunno..
-r
GnuVince
05-25-2002, 09:47 PM
I attached my code so that the page doesn't get too long. Here's a simple output:
[vince@vincent: ~/prog/ocaml/contest/l33t]% ./l33t
> Dru is a Java King
Dru |$ @ J@v@ K|ng
> Inkedmn is a Python leet
1nk3dmn |$ @ Py7H()n l337
>
Till later l33t hax0r!
[vince@vincent: ~/prog/ocaml/contest/l33t]%
inkedmn
05-25-2002, 10:12 PM
here's the python output:
D:\python\code>python 1337.py
Enter some text: coderforums.net: the other white meat
7r@n$1@7\()n: c()d3rp|-|()rum$.n37: 7h3 ()7h3r wh|73 m3@7
:)
code is attached
[edit]
i'm just going to post the code because the attaching function here ran the code all together.
so here it is:
#!/usr/bin/env python
dict = { 'A': '4', 'E': '3', 'F': 'ph', 'H': '}{', 'I': '|', 'O': '0', 'S': '5', 'T': '7', 'a': '@', 'e': '3', 'f': 'p|-|', 'i': '|',
'o': '()', 's': '$', 't': '7' }
def leet(text):
newstuff = ''
for letter in text:
if dict.has_key(letter):
newstuff += dict[letter]
else:
newstuff += letter
print "7r@n$1@7\()n: " + newstuff
if __name__ == '__main__':
text = raw_input("Enter some text: ")
leet(text)
:)
iDxMan
05-25-2002, 10:23 PM
Gotta have a php version
<html>
<title>Vince/Ink's l33t challenge</title>
<body>
<form action="<?=$PHP_SELF?>" method="POST">
Input:
<textarea name="text" cols="50" rows="10">
<?=$text?>
</textarea>
<input type="submit" value="Submit">
</form>
<hr />
<pre>
<?php
$tbl = array('a' => '@', 'e' => '3',
'f' => 'p|-|', 'h' => 'H',
'i' => '|', 'o' => '()',
's' => '$', 't' => '7',
'A' => '4', 'E' => '3',
'F' => 'ph', 'H' => '}{',
'I' => '1', 'O' => '0',
'S' => '5', 'T' => '7' );
echo strtr($text, $tbl);
?>
</pre>
</body>
</html>
iDxMan
05-25-2002, 10:43 PM
Oh yeah. What's the prize?
A snot rocket to the shoe ?
-r
inkedmn
05-25-2002, 10:46 PM
a night of dinner and dancing with our very own GnuVince!!!
;)
GnuVince
05-25-2002, 10:56 PM
Originally posted by iDxMan
Oh yeah. What's the prize?
A snot rocket to the shoe ?
-r
4ll j00r p33rz w1ll ph34r t3h j00!!!!!~~
Bradmont
05-25-2002, 10:57 PM
in c:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
/* here's our replacement table. */
char * replacements[123] = {"", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "4",
"B", "C", "D", "3", "ph", "G", "}{", "1", "J", "K", "L", "M", "N", "O",
"P", "Q", "R", "5", "7", "U", "\\/", "W", "X", "Y", "Z", "", "", "", "", "",
"", "@", "b", "c", "d", "3", "p|-|", "g", "H", "|", "j", "k", "l", "m",
"n", "()", "p", "q", "r", "$", "7", "u", "v", "w", "x", "y", "z"};
int main(int argc, char ** argv){
int i, j;
if (argc == 1){ /* we have no args */
printf("Usage: %s <text to translate\n", argv[0]);
return 1;
}
for (j=1; j < argc; j++){ /* each arg */
for (i=0; i < strlen(argv[j]); i++){ /*letter by letter */
if (isalpha(argv[j][i])) /*only replace it if it's a letter */
printf("%s", replacements[argv[j][i]]);
else
printf("%c", argv[j][i]);
}
printf(" ");
}
printf("\n");
return 0;
}
and here it is in action
bradmont@bradmont ~/cs/c% ./leetify I am oh so leet.
1 @m ()H $() l337.
bradmont@bradmont ~/cs/c% ./leetify Gnuvince and inkedmn make leet challenges.
Gnuv|nc3 @hd |hk3dmn m@k3 l337 cH@ll3ng3$.
iDxMan
05-25-2002, 11:01 PM
Originally posted by GnuVince
4ll j00r p33rz w1ll ph34r t3h j00!!!!!~~
Hmm.. Next challenge : l33t to regular text.
-r
inkedmn
05-25-2002, 11:02 PM
oo00oo...
/me begins thinking THAT one over...
GnuVince
05-25-2002, 11:06 PM
Originally posted by iDxMan
Hmm.. Next challenge : l33t to regular text.
-r
That could be harder, because some letters in l33t are more than one character long.
iDxMan
05-25-2002, 11:44 PM
Originally posted by GnuVince
That could be harder, because some letters in l33t are more than one character long.
Yeah a bit harder.. I have it working except for `()` to `o` . Damn regex.
-r
xilica
05-26-2002, 12:14 AM
aight, im done.... took me about an hour... here is the code
this is in Visual BAsic......thats wut im talkin about
Private Sub Command1_Click()
Dim i As Long
Dim sIn As String
Dim sTemp As String
Dim sOut As String
sIn = txtIn.Text
For i = 1 To Len(sIn)
sTemp = Mid$(sIn, i, 1)
Select Case sTemp
Case "a"
sOut = sOut & "@"
Case "b"
sOut = sOut & "b"
Case "c"
sOut = sOut & "c"
Case "d"
sOut = sOut & "d"
Case "e"
sOut = sOut & "e"
Case "f"
sOut = sOut & "p|-|"
Case "g"
sOut = sOut & "g"
Case "h"
sOut = sOut & "H"
Case "i"
sOut = sOut & "|"
Case "j"
sOut = sOut & "j"
Case "k"
sOut = sOut & "k"
Case "l"
sOut = sOut & "l"
Case "m"
sOut = sOut & "m"
Case "n"
sOut = sOut & "n"
Case "o"
sOut = sOut & "()"
Case "p"
sOut = sOut & "p"
Case "q"
sOut = sOut & "q"
Case "r"
sOut = sOut & "r"
Case "s"
sOut = sOut & "$"
Case "t"
sOut = sOut & "7"
Case "u"
sOut = sOut & "u"
Case "v"
sOut = sOut & "v"
Case "w"
sOut = sOut & "w"
Case "x"
sOut = sOut & "x"
Case "y"
sOut = sOut & "y"
Case "z"
sOut = sOut & "z"
Case "A"
sOut = sOut & "4"
Case "B"
sOut = sOut & "B"
Case "C"
sOut = sOut & "C"
Case "D"
sOut = sOut & "D"
Case "E"
sOut = sOut & "3"
Case "F"
sOut = sOut & "ph"
Case "G"
sOut = sOut & "G"
Case "H"
sOut = sOut & "}{"
Case "I"
sOut = sOut & "1"
Case "J"
sOut = sOut & "J"
Case "K"
sOut = sOut & "K"
Case "L"
sOut = sOut & "L"
Case "M"
sOut = sOut & "M"
Case "N"
sOut = sOut & "N"
Case "O"
sOut = sOut & "0"
Case "P"
sOut = sOut & "P"
Case "Q"
sOut = sOut & "Q"
Case "R"
sOut = sOut & "R"
Case "S"
sOut = sOut & "5"
Case "T"
sOut = sOut & "7"
Case "U"
sOut = sOut & "U"
Case "V"
sOut = sOut & "V"
Case "W"
sOut = sOut & "W"
Case "X"
sOut = sOut & "X"
Case "Y"
sOut = sOut & "Y"
Case "Z"
sOut = sOut & "Z"
End Select
Next i
txtOut.Text = sOut
End Sub
txtIn.text = ink and vince are ELITE
txtOut.text = |nk @nd v|nce @re 3L173
sorry for not redirecting it...... i am anxious to show u my force in my l33t skillz.... anyway... i can link it if you want me two...... by the way here is the link for my interface:
www.tmstadium.com/extrastuff/VisualBasicEncrypt.jpg
GnuVince
05-26-2002, 12:17 AM
xilica: You don't have spaces in your output on your screenshot
xilica
05-26-2002, 12:19 AM
uh..... oh shit... do i need them?
buh jesus
i dont need them.... im ELITE
GnuVince
05-26-2002, 12:23 AM
You need them, it's part of the deal.
xilica
05-26-2002, 12:28 AM
crap.. i hope i am l33t enough for that....
*goes to the drawing board*
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.