[rec.games.mud] Propaganda Speak 1.0 by Phillip 'Edward' Nunez

phillip@soda.Berkeley.EDU (Phillip 'Edward' Nunez) (01/19/91)

This is the new filter program that I described last night in my CALL FOR
DISCUSSION on rec.arts.tv.desert-shield (which would be a newsgroup where
you can talk about all of the neat visuals seen on network TV recently,
such as missiles heading in at Iraq.)  To compile propagandaspeak on your
computer, delete everything up to the --CUT HERE-- line and then type:

philcc -cool propagandaspeak.c -o propagandaspeak

If you don't have that cool compiler, you can use cc or gcc or p++.  
Just type something like this:

gcc propagandaspeak.c -o propagandaspeak -Dphillip -O
cc propagandaspeak.c -o propagandaspeak -Dphillip -O
p++ -waycool -dynamic -objectoriented -distributed propagandaspeak.c -o propagandaspeak -Dphillip

Propagandaspeak was developed after watching many hours of news propgrams.
I don't really know why I wrote it, I just suddenly felt compelled to
create this new filter program. 

To use propagandaspeak, by Phillip 'Edward' Nunez, pipe other operations
through it.  Cool examples:

cat /etc/motd | propagandaspeak
telnet mud.upenn.edu 2324 | propagandaspeak
rlogin graft.berkeley.edu -l chelsea | propagandaspeak

Have fun.  Edit friends' finger info, so that their shell is 
/bin/csh | propagandaspeak.  Edit .forwards so that all mail is
filtered through propagandaspeak.  Enjoy!

Send all bugs and comments to Phillip 'Edward' Nunez (phillip@soda.berkeley.edu)

-- THIS IS THE CUT HERE LINE.  DELETE UP TO HERE AND THEN TYPE PHILCC --
/* propagandaSpEak versioN 1.0 is copyright phillip 'eDward' nunez,
   all rights reserved.  you May freely distribute this cOol copyrighted
   software as loNg as you do not sEll it and You do not Take Off this
   coPyright statement wHIch mentions my (phiLLIP EDWARD NUNEZ) name.
   enjoy propaganda speak, and write me at my account, phillip@
   soda.berkeley.edu for suggestions for enhancements.  

                    --phillip edward nunez
*/



#include <stdio.h>
#include <sys/time.h>

#ifdef X11
    #include <X11/X.h>
#endif                             /* for comp.sources.x */

static char *version = "prOpagandaspeak 1.0 By phillip nunEz, copYright 1991\n";

#ifdef IBM
    version = "prOpagandaspeak 1.0iBm by phillip nunEz, copYright 1991\n";
#endif IBM                        /* for comp.sys.ibm */

char *choice;

char *propaganda[] = {
    "obey",
    "watchtv",
    "nocasualties",
    "thecomputerisyourfriend",
    "sleep",
    "work",
    "play",
    "trustme",
    "phillip",
    "tinymuch",
    "servethegovernment",
    "paytaxes",
    "workallday",
    "sleepallnight",
    "hundredsifnotthousandsofdollars",
    "theowlsarenotwhattheyseem",
    "keepyourlaserhandy",
    "serve",
    "eat",
    "buy",
    "marryandreproduce",
    "postoften",
    "watchthesimpsons",
    "bart",
    "sacrifice",
    "eatdrinkandbemerry",
    "satandoginthewhitehouse",
    "readmylipsnonewtaxes",
    "godiswithus",
    "executetraitors",
    "asknotwhatyourcountrycandoforyou",
    "consume",
    "behappy",
    "peaceinourtime"
};

#define PHRASECOUNT (sizeof(propaganda)/sizeof(int))

void main(int argc, char *argv[]) {

    char c;

    if (argc > 1) {
        if (*argv[1]=='v'||*(argv[1]+1)=='v') {
            fputs(version, stdout);
            exit(0);
	} 
        fputs("usage: cat <file> | propagandaspeak", stderr);
        fputs("       propagandaspeak -v", stderr);
        exit(1);
    }

    srand(time(0));
    choice = propaganda[rand()%PHRASECOUNT];

    while ((c=getchar()) != EOF) {
        c = isupper(c) ? tolower(c) : c;
        if (c == *choice) {
	    putchar(toupper(c));
	    if (*++choice=='\0') choice = propaganda[rand()%PHRASECOUNT];
	} else putchar(c);
    }
}