home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hackers Toolkit v2.0
/
Hackers_Toolkit_v2.0.iso
/
HTML
/
archive
/
IRC
/
random.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-11-04
|
978b
|
44 lines
/* James Manning (Flav@IRC) 1/29/94 at 7:30am */
/* to set up the irc alias: */
/* cc -o random random.c */
/* /ALIAS morph /exec -out echo "$0-" | random */
/* name of the compile of this code ^^^^^^ */
/* Then just "/morph whatever you want to say" */
#include <stdio.h>
#include <stdlib.h>
char set_to_lower(char tmp){
char x = tmp;
if((x<='Z')&&(x>='A')) {
x -= 'A';
x += 'a';
}
return x;
}
char return_random(char tmp){
char x = tmp;
if ((((x<='Z')&&(x>='A'))||((x<='z')&&(x>='a')))&&((rand()%100)>50)){
x -= 'a';
x += 'A';
}
return x;
}
main(){
char a_char;
srand(getpid());
a_char = getchar();
while(a_char!=EOF){
switch(rand()%3){
case(0): printf("\026"); break;
case(1): printf("\002"); break; /* adds in random ^V ^B and ^_ */
case(2): printf("\037"); break; /* uncomment if wanted */
}
printf("%c",return_random(set_to_lower(a_char)));
a_char = getchar();
}
}