Files
ioccc/1994/shapiro
Landon Curt Noll f29b37e49a improve HTML menus, add social.html, prep for IOCCC28 winners
Prepare for the winners of **IOCCC28**.

> However these are not the 2024 droids you are looking for.  :-)

The HTML menu (both JavaScript and non-JavaScript) has been updated.

The `Status -> Rules and guidelines' have been replaced with two
separate menus `Status -> IOCCC rules` and `Status -> IOCCC guidelines`.

Added a new top level `social.html` page: built from a new `social.md`.

Sorted rules for building specific web pages in the top level `Makefile`.
Added `make social` to make the `social.html` page from `social.md`.

The `bin/gen-top-html.sh` now is able to process a argument of **social**
to process the new top level `social.html` page.

Changed `bin/gen-top-html.sh` VERSION from "2.0.0 2025-03-13"
to "2.0.1 2025-07-25".

Below `About -> Home page` a new `About -> IOCCC social media` menu item
as added.

Because the menu change touched every HTML file, we changed the general
copyright date range for HTML files from "1984-2024" to "1984-2025"
due to the extensive changes made for **IOCCC28**.

Those markdown files that were modified in 2025 had their copyright date
range also changed from "1984-2024" to "1984-2025".

Rebuilt tarballs and sitemap due to the extensive HTML rebuilding.

Ran `make update` to perform the above.
2025-07-26 13:06:29 -07:00
..
2024-12-27 10:31:54 -08:00
2024-06-24 13:55:19 -07:00
2023-07-06 21:49:38 -07:00

To build:

    make all

There is an alternate version that is unobfuscated, provided by the author. See Alternate code below.

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 1994/shapiro in bugs.html.

To use:

    ./shapiro &

Now find the clock in the same terminal window (or console if at the console).

Try:

    ./shapiro
    ^Z
    bg
    ps x
    fg
    ^C

    ./shapiro_t1

Notice what you see in the output of ps! Observe too what happens after you bring it back to the foreground.

Alternate code:

This version, shapiro.alt.c, is an unobfuscated version provided by the author.

Alternate build:

    make alt

Alternate use:

Use shapiro.alt as you would shapiro above.

Judges' remarks:

This entry has many different levels of obfuscation, and yet the source file is self documenting. :-)

From time to time, run ps(1) and look at the new processes.

If you want more information on the internals of this program, see shapiro.html.

Author's remarks:

The basic theme (pun) of this program is:

"This time (everything) is not where it should be."

NOTICE to those who wish for a greater challenge:

If you want a greater challenge, don't read any further: just try to understand the program via the source.

If you get stuck, come back and read below for additional hints and information.

My entry, shapiro.c, is mostly comments, formatted in the shape of a clock. If you strip out the comments and look at the code you will quickly realize that the comments were the important part and that the code does very little (see pun above). It writes (to stdout) another C program (shapiro_t2.c). This is the first level of obfuscation.

The second program (shapiro_t2.c) prints a clock in the upper right hand corner of your VTxxx/ANSI display.

Most of the surface obfuscation in the second program, shapiro_t2.c, was an attempt to make it as small as possible. You should be able to see around this with cb(1) and some more intelligent variable names. Once you get past this you will realize that the third level of obfuscation is a six member client/server hierarchy. (See the shapiro.html web page for a detailed description of the algorithm.)

lint complains about: precedence confusion, K may be used before set, main() returns random value to invocation environment, value type used inconsistently, value type declared inconsistently, function argument (number) used inconsistently, function returns value which is always ignored, function returns value which is sometimes ignored. All of which are harmless (famous last words).

This may or may not work on non ASCII systems (I could not find one to test it on.)