Skip to content

Instantly share code, notes, and snippets.

@rw-r-r-0644
Created May 14, 2017 14:53
Show Gist options
  • Save rw-r-r-0644/6b79bd78cf04e7552bc4b632cd360761 to your computer and use it in GitHub Desktop.
Save rw-r-r-0644/6b79bd78cf04e7552bc4b632cd360761 to your computer and use it in GitHub Desktop.
1337 translator!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define repl(a, b) if(str[i]==a)str[i]=b
int main(int argc, char *argv[])
{
char * str = calloc(strlen(argv[1] + 1), 1);
strcpy(str, argv[1]);
for (int i = 0; str[i]; i++)
{
repl('a', '4');
repl('e', '3');
repl('i', '!');
repl('o', '0');
repl('g', '6');
repl('s', '5');
repl('t', '7');
repl('z', '2');
}
puts(str);
free(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment