Files
ioccc/2018/anderson
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
..
…
2023-07-06 21:49:38 -07:00

To build:

    make

There is an alternate version of this entry. See Alternate code below for more details.

To use:

    ./prog < textfile

Try:

    ./try.sh

Alternate code:

Compare prog.c and prog.alt.c and find out why we had to modify the entry, and what confused the author (see the author's remarks). No, it was not the shape of the Roman V that we, or the compiler, didn't like.

Alternate build:

    make alt

Alternate use:

Use prog.alt as you would prog above.

Alternate try:

    ./try.alt.sh

Judges' remarks:

With this entry, you won't need to turn your monitor upside down!

Author's remarks:

Compiling the program:

    cc -Wall -Wextra -Wpedantic -O3 -std=c11 prog.c -o prog

Also works with a standard of C99, but C90/C89 will not compile due to for loop initial declarations, along with additional warnings about variable length arrays and lack of a return statement.

Additional info:

This small program, when given text on stdin, will produce a pattern of squiggly lines. This pattern is deterministic, and it shouldn't be too difficult to determine from whence they come. There is even a comment that describes the highlighted phenomena in the source, for those that require a small nudge. With denser text blocks, such as an essay or similar prose, the output can be rather pretty, in an chaotic emergence sort of way. Try using this file, or the source file as inputs.

In its current form, this program can handle lines of length 255; to adjust this limit, change the variable a at the top of the source. Other adjustments, such as the exact printed characters, are rather easy, once sufficient reverse engineering has occurred. Improvements such as proper handling of tabs are left as an exercise to the reader.

In developing this program, the author found a potentially interesting bug. If the expression (j=k,j) (near the middle of the source) is changed to (j=k,k), the program produces different output. The author used gcc 5.4.0, compiled for x86_64-linux-gnu. Enabling or disabling optimization produces the same results. The author is not sure who is the culprit, but instead shrugged and moved on with life. Of course, YMMV with your own environment.

The structure of this program, as you may have deduced, is two for loops, one nested in the other. There are also a bunch of direct variable assignments, such as j=k. There is some filler fluff, such as 0-0+0, but all that sort should be rather easy to spot. It was mostly added for the purpose of making certain things line up right, and only secondarily to obfuscate.