Name: Anonymous 2012-10-07 19:34
SUPERBOLD
#!/usr/bin/perl -l40
use encoding utf8;
y/!-~/\x{ff01}-\x{ff5e}/ and print for @ARGV
kindabad () {
if [ -z "$1" ]
then
perl -M'encoding(utf8)' -p -e 'y/!-~/\x{ff01}-\x{ff5e}/'
else
echo $@ | perl -M'encoding(utf8)' -p -e 'y/!-~/\x{ff01}-\x{ff5e}/'
fi
}#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
const char a = "[]!@#$%^&*()1234567890-=abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char b = "[]!@#$%^&*()1234567890-=abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(void)
{
char * c = (char*) malloc(10000000 * sizeof(char)); // no one will type ten mibibytes
char * d = (char*) malloc(10000000 * sizeof(char)); // output
for(int i = 0; i < 10000000 * sizeof(char) - 1; i++) d[i] = c[i] = '\0';
printf("String:");
scanf("%s", &c);
int l = strlen(c);
int l2 = strlen(a);
int matched = 0;
for(int j = 0; j < l - 1; j++)
{
matched = 0;
for(int k = 0; k < l2 - 1; k++)
{
if(c[j] == a[k])
{
d[j] = b[k];
matched = 1;
break; // we are done here :)
}
}
if(matched == 0) // we didn't match anything :(
{
d[j] = c[j];
continue;
}
}
printf("\a\a\a\a\nDone!\n\n%s%d\r%s",c,sleep(5),d); // show the original, sleep a bit, then use \r to overright the the first with the output
}
printf("\a\a\a\a\nDone!\n\n%s%d\r%s",c,sleep(5),d);const char a = "[]!@#$%^&*()1234567890-=abcdefghjklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";i < 10000000 * sizeof(char) - 1; i++) d[i] = c[i] = '\0';
scanf over simple getchar or ... wait, why aren't you just using constant offsets what the fuck are you doing.
#include <locale.h>
#include <stdio.h>
int main(void)
{
int c;
if (setlocale(LC_ALL, "") == NULL)
return -1;
while (EOF != (c = getchar())) {
if (c <= '~' && c >= '`')
printf("%c%c%c", -17, -67, (-128 + (c - '`')));
else if (c < '`' && c >= '!')
printf("%c%c%c", -17, -68, (-128 + (c - ' ')));
else
printf("%c", c);
}
}