Another Silly programming puzzle....

Iain Davidson t-iaind at microsoft.UUCP
Mon Apr 3 10:50:08 AEST 1989


(This is my first BIG post, so if you want to flame, flame low and send away)

   For those still silly over the LAST puzzle/challange.... here's another one.

Puzzle:
  Write a "simple" program to convert rec.humor (rot13) jokes to
    a output readable by human eyes...

Simple rules:
   1) It works.
   2) I can understand it.
   3) Sources in "C", Pascal, MOD-2, Pilot, or csh-source
                  format are acceptable.

Two catagories.
   a) fastest
   b) smallest (least # of characters not including standard_IO includes or
        main(arg,arg) {} code, and  ignoring white space '/n', <SPACE>
        (CR's,LF's,etc) for readablity.

Two levels of difficulty:
  1) using builtin functions of a OS   i.e. ">" "<" for UNIX
  2) using standard file operations of open/close.

  Here's an example 
( not working and NOT tested, only by my limited knowledge of c )


  main()
  {
	char c;

	while((c=getchar()!=EOF)
		if( (('a' < c) && ('z' > c)) || (('A' < c) && ('Z' > c)) ) {
			c=lower(c);
			putchar( (c>'m' : c-13 ? c+13) );
		}
}


(I'll summurize and post results..., good luck and may the gods go with you...)

Iain Davidson, formally of (Bellingham, WA)'s BelAmi! Fame

UUCP: {uucp|uw-beaver}!microsof!t-iaind       (How did he move that "t" ???)
BITNET:  microsof!t-iaind at beaver.cs.washington.edu
    for really smart mailers:  t-iaind at microsoft.BITNET or .CSNET or .UUCP
********** Disclaimer: *********
  My employer and fellow employees will (have, has) disclaim anything I say
past, future, or present......  so there !!!!.... :P
-----------------------------------------------------------------



More information about the Comp.lang.c mailing list