/**********
 **********  The Lame Filter            Version 2.5.lame.lame.lame.ddm
 **********  by zorgo                   1/9/93
 **********
 **********  This code is too lame to be Commercial,
 **********  too lame to be Shareware,
 **********  too lame to be Public Domain,
 **********  too lame to be GNU copylefted, 
 **********  it's Lameware!
 **********
**********/


#include <stdio.h>
#include <ctype.h>
#include <time.h>


/********************************************************************/
/********************************************************************/
lamerize(buf, out)
char buf[];
char *out;
{
	register int j,  count=0;

	time_t t;

		srand((unsigned) time(&t));

		for(j=0; j<strlen(buf); j++) {
			if( buf[j]=='y' && buf[j+1]=='o' && buf[j+2]=='u') {
				out[count++]='U'; j+=2;
			}
			else if( buf[j]=='o' || buf[j]=='O') {
				if( rand()%3==1 ) {
					out[count++]='('; out[count++]=')';
				} else out[count++]='0';
			}
			else if( buf[j]=='a' && buf[j+1]=='n' && buf[j+2]=='d') {
				out[count++]='&'; j+=2;
			}
			else if((buf[j]=='i' || buf[j]=='I')&&(rand()%5>=2)) {
				out[count++]='1';
			}
			else if( buf[j]=='l' && (rand()%3==1)) {
				out[count++]='|';
			}
			else if(buf[j]=='s'&&(buf[j+1]=='\0'||ispunct(buf[j+1]))){
				out[count++]='z'; out[count++]='z';
			}
			else if( (buf[j]=='e' || buf[j]=='E') &&(rand()%5 >= 3) ) {
				out[count++]='3';
			}
			else if( rand()%5==1 ) out[count++]=toupper(buf[j]);
			else out[count++]=buf[j];
		}

		out[count]=NULL;

		return(1);
}
