Files
ioccc/1989/fubar/README.md
T
Cody Boone Ferguson a480a0dee4 Move INABIAF to bugs.md in 1980s entries
Having to click on the links in each README.md file will have to be done
to verify the links work but it appears to be in the form of:

    /bugs.md#YYYYauthor-readmemd
2023-10-23 09:05:47 -07:00

1.5 KiB

Best self-modifying program

Jay Vosburgh
US

To build:

make all

Bugs and (Mis)features

This entry a listed in bugs.md as:

STATUS: INABIAF - please **DO NOT** fix

For more detailed information see bugs.md.

To run:

./fubar <number>

Try:

./fubar 2

Judges' remarks:

Run this with a single digit argument (or wait a long time and risk an infinite loop as described above).

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

NOTE: the file ouroboros.c is created by the program itself so this is why it is not in the repository.

Author's remarks:

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.

This file is Copyright (c) 2023 by Landon Curt Noll. All Rights Reserved. You are free to share and adapt this file under the terms of this license:

Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)

For more information, see: https://creativecommons.org/licenses/by-sa/4.0/