#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define MAX_BUFFER 1024
const char * leet_from_str(const char *s)
{
static char buffer[MAX_BUFFER];
static int MAX_INDEX = ( 'z' - 'a' ) + 1;
static const char * leet_alphabet[] = {
"4",
"8",
"(",
"C-",
"3",
"|",
"C-",
"#",
"1",
"]",
"|<",
"|_",
"[V]",
"/V",
"0",
"|7",
"9",
"|2",
"5",
"7",
"|_|",
"\\/",
"\\N",
"><",
"'/",
"2",
};
const char * chs = s;
*buffer = '\0';
while( *chs != '\0' ) {
if ( index < 0
&& index >= MAX_INDEX )
{
fprintf( stderr
, "ERROR: se esperaba 'a'-'z', no: %c\n", *chs
); }
strcat( buffer
, leet_alphabet
[ index
] ); ++chs;
if ( strlen( buffer
) >= ( MAX_BUFFER
- 2 ) ) { break;
}
}
return buffer;
}
int main(void)
{
printf( "%s\n", leet_from_str
( "Baltasar" )); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPGN0eXBlLmg+CgojZGVmaW5lIE1BWF9CVUZGRVIgMTAyNAoKCmNvbnN0IGNoYXIgKiBsZWV0X2Zyb21fc3RyKGNvbnN0IGNoYXIgKnMpCnsKICAgIHN0YXRpYyBjaGFyIGJ1ZmZlcltNQVhfQlVGRkVSXTsKICAgIHN0YXRpYyBpbnQgTUFYX0lOREVYID0gKCAneicgLSAnYScgKSArIDE7CiAgICBzdGF0aWMgY29uc3QgY2hhciAqIGxlZXRfYWxwaGFiZXRbXSA9IHsKICAgICAgICAiNCIsCiAgICAgICAgIjgiLAogICAgICAgICIoIiwKICAgICAgICAiQy0iLAogICAgICAgICIzIiwKICAgICAgICAifCIsCiAgICAgICAgIkMtIiwKICAgICAgICAiIyIsCiAgICAgICAgIjEiLAogICAgICAgICJdIiwKICAgICAgICAifDwiLAogICAgICAgICJ8XyIsCiAgICAgICAgIltWXSIsCiAgICAgICAgIi9WIiwKICAgICAgICAiMCIsCiAgICAgICAgInw3IiwKICAgICAgICAiOSIsCiAgICAgICAgInwyIiwKICAgICAgICAiNSIsCiAgICAgICAgIjciLAogICAgICAgICJ8X3wiLAogICAgICAgICJcXC8iLAogICAgICAgICJcXE4iLAogICAgICAgICI+PCIsCiAgICAgICAgIicvIiwKICAgICAgICAiMiIsICAgIAogICAgfTsKICAgIAogICAgY29uc3QgY2hhciAqIGNocyA9IHM7CiAgICAqYnVmZmVyID0gJ1wwJzsKICAgIAogICAgd2hpbGUoICpjaHMgIT0gJ1wwJyApIHsKICAgICAgICBpbnQgaW5kZXggPSB0b2xvd2VyKCAqY2hzICkgLSAnYSc7CiAgICAgICAgCiAgICAgICAgaWYgKCBpbmRleCA8IDAKICAgICAgICAgICYmIGluZGV4ID49IE1BWF9JTkRFWCApCiAgICAgICAgewogICAgICAgICAgICBmcHJpbnRmKCBzdGRlcnIsICJFUlJPUjogc2UgZXNwZXJhYmEgJ2EnLSd6Jywgbm86ICVjXG4iLCAqY2hzICk7CiAgICAgICAgfQogICAgICAgIAogICAgICAgIHN0cmNhdCggYnVmZmVyLCBsZWV0X2FscGhhYmV0WyBpbmRleCBdICk7CiAgICAgICAgKytjaHM7CiAgICAgICAgCiAgICAgICAgaWYgKCBzdHJsZW4oIGJ1ZmZlciApID49ICggTUFYX0JVRkZFUiAtIDIgKSApIHsKICAgICAgICAJYnJlYWs7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gYnVmZmVyOwp9CgoKaW50IG1haW4odm9pZCkKewogICAgcHJpbnRmKCAiJXNcbiIsIGxlZXRfZnJvbV9zdHIoICJCYWx0YXNhciIgKSk7CiAgICByZXR1cm4gMDsKfQo=