Files
ioccc/2001/ollinger
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-05-29 11:36:55 -07:00
2023-07-06 21:49:38 -07:00
2024-08-05 09:48:14 -07:00

To build:

    make

Bugs and (Mis)features:

The current status of this entry is:

STATUS: INABIAF - please DO NOT fix

For more detailed information see 2001/ollinger in bugs.html.

To use:

    ./ollinger integer

Try:

    ./try.sh

Try the above command in a large window, say 200 chars wide and 100 high (200x100) with a tiny font.

Judges' remarks:

Do get lost in the program's line of thought! :-)

Author's remarks:

What's this?

What do you see? On the left, you will see an enumeration of all successive primes from 2 to the parameter you gave to the program. On the right part, you can see the sieve used to find these primes. The big diagonals from right to left are used to erase composed numbers. When no diagonal crosses a number, then the left cell take value 1 and the number is prime.

The parallel version of this algorithm works in real time n. This C sequential version is slower as it works in O(n*log n). But you have some nice picture instead... the cost is a constant number of operation for each character printed on the screen.

Why did I write this ?

Let's just quote the IOCCC FAQ:

Q: Are there types of entries that are submitted so frequently that the judges get tired of them?

A: Yes, there are types of entries that show up over and over again. The guidelines say:

We tend to dislike programs that:
    are similar to previous winning entries

We like variety. However too often we see (please look at the winning examples given to be aware of the level of the competition):

(snip)

generating small primes (below is the list of all prime related entries)

1985/august
1988/applin
1994/weisberg
1995/makarios
1996/dalbec
2000/bellard

As you can see, just a list of primes (let alone small primes) does not cut it anymore.

(snip)

entries that use some complex state machine/table to print something

1988/isaak
1988/phillipps

Unbeaten for 12 years and counting...

I think this is enough motivation for trying to submit a program which uses some complex state machine/table to generate small primes and print them.

The way it works

This program simply prints the space-time diagram of some particular cellular automaton. The automaton is a 9-state automaton by Ivan Korec in 1998. It is an optimization of an old automaton for recognizing primes designed by Fischer in 1965.

The table of the automaton is encoded into the string e and consists of 345 transitions of the kind ff(left,middle,right). This encoding into e is obfuscated to reduce its size, restrict it to characters 32 to 127 and guarantee a constant time.

The main loop simply iterates this transition function on each cell.

"The rest is silence"

(Hamlet, V.2)

Enjoy!