Files
ioccc/1989/fubar/README.md
T
Cody Boone Ferguson 9d63c37f49 Get 1989 entries to compile
There were some which cannot be compiled under clang. One entry we used
a patch from Yusuke Endoh to get the entry to compile; thank you Yusuke
for your assistance! Another one we used a patch from Yusuke (thank
you!) but I further fixed it so that it would work with clang. It had to
be done: IOCCC Tetris has to work! This was done by changing the
environment arg to main() to be a char * in main() itself rather than a
char **. Using a char ** in main() third arg got it to compile but only
one key worked with clang so I changed it to be not the third argument
but a regular char * in main(). **a (third arg) evaluated correctly but
*a[1] and onward was actually part of the environment. Again IOCCC
Tetris has to work!

I also fixed fubar to work which took a few tweaks.

README.md files were also updated.
2023-03-06 09:04:46 -08:00

1.3 KiB

Best self-modifying program:

Jay Vosburgh
    Sequent Computer Systems, Inc
    15450 SW Koll Parkway
    Beaverton, OR
    97006
    USA

To build:

    make all

To run

./fubar 2

Judges' comments

Run this with a single digit argument (or wait a long time).

The blank line at the beginning of the source is mandatory. Do you know why?

With a bit of tinkering Cody Boone Ferguson got this to work on modern systems. We thank him for his assistance!

Author's comments

In a nutshell, this is probably the slowest and most
obnoxious factorial program ever written.  Unfortunately, 
the name of the C source must be "ouroboros.c"; the name is 
hard-coded into the program.  

The source is a legal shell script and a legal C program.  
The shell script compiles itself, and then executes the
resulting binary, giving the source as input.  The program 
works by successively modifying #define lines each pass through.

Both "indent" and "cb" will damage the program, "indent" 
much more so.

Copyright (c) 1989, 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.