Files
ioccc/1988/westley
Landon Curt Noll c78bda6c0f update tarballs due to recent commits
The commit a1c86c8a7a modified
the navigation bars to include "Original C", so all tarballs
had be update, sorry (tm Canada 🇨🇦).  In particular:

The navigation bar for a winning entry now has a "_Original C_" link
(between the ✅ and the Inventory on the right hand side) so that one
may easily view the original C code that was submitted for IOCCC judging.

In addition, a number of other commits since that time
modified other winning entries.

Ran `make update` to perform the above.
2025-08-18 16:30:59 -07:00
..
2023-04-13 14:24:34 -07:00
2023-11-14 02:43:14 -08:00
2023-07-06 21:49:38 -07:00

To build:

    make all

NOTE: this version is a fixed version for modern C compilers. See the Alternate code section below for how to use the original and why one might wish to do so.

Try:

    ./westley

Also try:

    ./try.sh

to show the code with followed by the result so you can truly see the magic.

Alternate code:

This version is the original which might not work as you expect nowadays.

Alternate build:

    make alt

Alternate use:

To see if your compiler has the problem described in the Judges' remarks below, try:

    ./westley.alt

Does it show the same output as westley?

Judges' remarks:

Your compiler must parse

    #define _ -a
    -_

as --a and not -(-a) or some other tokenized form. Some strictly conforming ANSI C Preprocessors may object to this: for such compilers, you can elide the non-standard token-pasting requirement by changing the #define line to:

    #define _ F-->00||F-OO--;

This is what the modified code in westley.c does whereas the alternate code is the original.

You might enjoy looking at the output of:

    cc -E westley.alt.c

    cc -E westley.c

Author's remarks:

No remarks were provided by the author.