home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.test
- Path: sparky!uunet!utcsri!torn!nott!bnrgate!bcars267!news
- From: gakusei@bmerh136.bnr.ca (Andre Roy)
- Subject: **************** TO: RANDY BYERS *********************
- Message-ID: <1992Nov16.211237.27796@bnr.ca>
- Sender: news@bnr.ca (usenet)
- Nntp-Posting-Host: bmerh272
- Organization: Bell-Northern Research Ltd.
- Distribution: ont
- Date: Mon, 16 Nov 1992 21:12:37 GMT
- Lines: 126
-
-
- Randy - how's it going? I'm going to try to get a ride to Waterloo this
- weekend. I need you to save the following on the descartes - and maybe
- on your Amiga as well. The following is the source for a coding program,
- and a program that will prepare that output for posting, and another
- for "unpreparing" it. Please Reply - telling me that you have got these
- files. Try compiling them on the descartes (use vi to split it into 3 files).
- I'll tell you how to use them, and how to code and decode news, as well as
- the password that will be used.
-
- Thanks!
-
- Chris
-
- Programs follow:
-
-
- /*********************
- * PREPARE.C
- **********************/
-
-
- #include <stdio.h>
- #include <string.h>
-
- void main(argc,argv)
- int argc;
- char * argv[];
- {
- int c,d;
- int in=0;
-
- while ((c=getchar()) != EOF) {
- if (c<34) {
- if (!in) {
- in = 1;
- printf("!");
- d+=1;
- } /* if */
- printf("%c",c+34);
- d+=1;
- } else {
- if (in) {
- printf("!");
- in = 0;
- d += 1;
- } /* if */
- printf("%c",c);
- d+=1;
- } /* if */
- if (d>70) {
- printf("\n");
- d = 0;
- } /* if */
- } /* while */
- } /* main */
- /************************
- * CODE.C
- ************************/
-
- #include <stdio.h>
- #include <string.h>
-
-
- int eor(c1,c2)
- int c1,c2;
- {
- int ret;
-
- ret = (c1|c2) - (c1&c2);
- return(ret);
- }
-
- void main(argc,argv)
- int argc;
- char * argv[];
- {
- char c;
- int d=0,e;
- char string[100];
- int stringlen;
-
- strcpy(string,argv[1]);
- stringlen = strlen(string);
-
- for(e=0;e<stringlen;++e) {
- string[e] = string[e]+e;
- } /* for */
-
-
- while ( (c=getchar()) != EOF) {
- printf("%c",eor(c,string[d]));
- if (++d >= stringlen) {
- d = 0;
- } /* if */
- } /* while */
- } /* main */
-
- /*********************
- * UNPREP.C
- *********************/
-
- #include <stdio.h>
- #include <string.h>
-
- void main(argc,argv)
- int argc;
- char * argv[];
- {
- int c,d;
- int in=0;
-
- while ((c=getchar()) != EOF) {
- if (c == '\n') {
- ;
- } else if (c == '!') {
- in = (in+1)%2;
- } else {
- if (in) {
- printf("%c",c-34);
- } else {
- printf("%c",c);
- } /* if */
- } /* if */
- } /* while */
- } /* main */
-