12 days of Christmas C code, top secret style of code writing 
Author Message
 12 days of Christmas C code, top secret style of code writing


Quote:
> /*   Passed along and comments from Mike A. Harris

> Anyways, it prints on the screen the ENTIRE lyrics to the
> Christmas song "The Twelve Days of Christmas".  Looking at
> the code, you'll notice that there are NO words in it,
> however, they sure form on the screen when it is ran!  I
> tried to analyze the code for a week or so (a year ago) and
> it was very interesting.  It turns out that most of the
> program is a huge encrypted string.  When ran, the string is
> decrypted, and recursed 12 times, each time adding the next
> day of the song to the paragraph.  The result is that the
> entire song is printed on the screen just how you would sing
> it.  =

Do you (or anyone) know the origin of the 12 days program?

hamim.



Thu, 28 May 1998 03:00:00 GMT  
 12 days of Christmas C code, top secret style of code writing

Quote:


> >Do you (or anyone) know the origin of the 12 days program?
> /*
> LEAST LIKELY TO COMPILE SUCCESSFULLY:
>   Ian Phillipps, Cambridge Consultants Ltd., Cambridge, England
> */
> The "Note" seems to imply that Ian may not be the author but that's as
> far back as I can trace it!

Try the International Obfuscated C Code Contest, winners 1988 :
phillipps.c

[from the hint file:]

Quote:

>    Ian Phillipps
>    Cambridge Consultants Ltd
>    Science Park
>    Milton Road
>    Cambridge CB4 4DW
>    England

> Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
> All Rights Reserved.  Permission for personal, educational or
> non-profit use is granted provided this this copyright and notice are
> included in its entirety and remains unaltered.  All other uses must
> receive prior permission in writing from both Landon Curt Noll and
> Larry Bassel.

See http://reality.sgi.com/csp/ioccc/years.html

Brett Huber

--
... Our continuing mission: To seek out knowledge of C, to explore
strange UNIX commands, and to boldly code where no one has man page 4.
                  http://www.cs.mtu.edu/grads/Huber



Mon, 01 Jun 1998 03:00:00 GMT  
 12 days of Christmas C code, top secret style of code writing

Quote:

>Do you (or anyone) know the origin of the 12 days program?

>hamim.
>/*

The copy I've been dragging around with me for years includes the following
in the comment field:

/*
LEAST LIKELY TO COMPILE SUCCESSFULLY:
  Ian Phillipps, Cambridge Consultants Ltd., Cambridge, England

  An appropriate program for December 25th, this consists primarily of
  calls to main() combined by a lot of the ternary conditional (?:)
  operators. Have you ever seen a more forceful return? The judges note
  that this program looked like what you would get by pounding on the keys
  of a type writer at random.

  Note -- I have made a minor correction (for spelling) to line 48, where I
  added a missing comma at column 59. I also added the #include <stdio.h>
*/

The "Note" seems to imply that Ian may not be the author but that's as
far back as I can trace it!

P.S. The #include turns out to not be needed after all   8-)
--
Gary Seubert - UNIX Class of '73 B.C. ('B'efore 'C'pio)

"The number of UNIX installations is now above 50, and many more are
 expected."  - UNIX Programmer's Manual - Fifth Edition - June, 1974



Mon, 01 Jun 1998 03:00:00 GMT  
 12 days of Christmas C code, top secret style of code writing

 >
 > >Do you (or anyone) know the origin of the 12 days program?
...
 > The copy I've been dragging around with me for years includes the following
 > in the comment field:
...
 >   Ian Phillipps, Cambridge Consultants Ltd., Cambridge, England
...
 > The "Note" seems to imply that Ian may not be the author but that's as
 > far back as I can trace it!

Ian Phillipps is the author.  It is a winning entry from the 1988
International Obfuscated C Contest.
--
dik t. winter, cwi, kruislaan 413, 1098 sj  amsterdam, nederland, +31205924098
home: bovenover 215, 1025 jn  amsterdam, nederland; http://www.cwi.nl/~dik/



Tue, 02 Jun 1998 03:00:00 GMT  
 12 days of Christmas C code, top secret style of code writing


Quote:


>> >Do you (or anyone) know the origin of the 12 days program?

Yes, I wrote it.

Quote:
>> LEAST LIKELY TO COMPILE SUCCESSFULLY:
>>   Ian Phillipps, Cambridge Consultants Ltd., Cambridge, England

I now work for Unipalm Pipex (recently merged with UUnet).

Quote:
>> Copyright (c) 1988, Landon Curt Noll & Larry Bassel.

In fact, rule 5 for 1988 said:
5) The program must be of original work.  All programs must be
   in the public domain.  All copyrighted programs will be rejected.

Hence my program is in the public domain. I should be grateful, however,
if authorship information is attached to it when it circulates.

One aspect of the program, which the judges didn't really remark upon,
is its purity of implementation. There are no preprocessor statements at
all (the #include that someone else has added is, as has been pointed
out in this thread, unnecessary, and didn't form part of my entry).

There are also no variables and no assigments (look for an "=" in
vain!). The structure of the program is simplicity itself, being
composed as it is of just one statement, a "return". Also, since all the
output is by a single "putchar" call, it should be extremely portable.

Some time after submitting it, I realised that of course the line
                        return!
can be replaced by
                        return!!!
or even
                        return!!!!!
and you have my express permission to make this change, not that you
need it.

BTW, this program emerged by accident. I originally started with the
idea of writing the song by implementing in the C preprocessor a
computed COME FROM, as described in a 1970s Datamation article on
fortran. After a bit of a struggle, I decided that the preprocessor
wasn't powerful enough to do the job, so decided to do without it
altogether.

I am continually amazed at the longevity of this program. I wonder if
any of the real code I wrote at that time is still in use...

Ian



Tue, 02 Jun 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. 12 Days of Christmas - C Program

2. 12 days of Christmas sig.

3. 12 days of Christmas C program

4. Wanted: cryptic 12 days of xmas code

5. TOP SECRET MS (c) Win95 Code (humor)

6. OT Humor: The 12 Bugs of Christmas

7. Need help getting top 12 array values.

8. code writing style for MFC

9. Christmas Code

10. Christmas code

11. Christmas code - attribution

12. Secret key storage from code

 

 
Powered by phpBB® Forum Software