Files
ioccc/2000/primenum
Landon Curt Noll c1466f5165 build index.html for all winners
Updated manifest as per recent file changes.

Updated winner `.winner.json` to reflect the manifest changes.

Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over
all winning entries.

These tools had slight improvements in the help usage message:

* bin/gen-author.sh VERSION="1.3.1 2024-01-16"
* bin/gen-inventory.sh VERSION="1.0.1 2024-01-16"
* bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16"
* bin/subst.default.sh VERSION="1.1.1 2024-01-16"
* bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16"

The `bin/readme2index.sh` tool was improved so that
if the `index.html` file exists and the tool forms
the exact same content, then the file `index.html`
file is NOT touched.

* bin/readme2index.sh VERSION="1.1 2024-01-16"

We used the following command to generate `index.html` files
for all winning entries:

```sh
bin/all_run.sh -v 3 bin/readme2index.sh
```

NOTE: We have not (yet) built HTML files above the winner directory
level (e.g., no year level nor top level HTML), nor have be built
non-index HTML files for winners.

NOTE: By default we are running `pandoc(1)` with:

```
--fail-if-warnings=true
```

This means that any problems with markdown to HTML
generates an error.  This is done to be sure that
the HTML conversion is clean.

We had to fix the following `README.md` files:

* `2000/rince/README.md`

The reference [^2] was never used.  We made a guess that [^2] applies
to the same spot as [^1].  Perhaps there is a better spot where
[^2] applies?

NOTE: For every reference, there MUST be some place where that
reference is used.

* 2012/vik/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

* 2018/burton1/README.md

The reference [2] was duplicated.  We changed the
second [2] to [3].

NOTE: Every reference needs to have a unique number.

* 2020/carlini/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

We also found 2 errors in the `author/author_handle.json` file set:

* author/Anonymous_2001.json

The `author/Anonymous_2001.json` file was missing.

* author/Jari_Arkko.json

The winner ID for `1989_jar.1` had a typo.
2024-01-17 00:32:39 -08:00
..
2024-01-17 00:32:39 -08:00
2023-12-26 09:00:03 -08:00
2023-07-06 21:49:38 -07:00
2024-01-15 04:29:39 -08: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 2000 primenum in bugs.md.

To use:

echo n | ./primenum n

NOTE: n is an integer.

Try:

./try.sh

Judges' remarks:

Don't read the author remarks until you're ready for the spoiler. Just stop and read the program; it won't take long. Once you've figured out what it does, run it. It may surprise you.

This entry won, not because the obfuscation is impenetrable, but because it successfully fooled half of the judges, including me.

Author's remarks:

Description

For 15 years, IOCCC winners have obfuscated programs using esoteric, difficult-to-interpret, confusing algorithms. This entry finally bucks that trend and obfuscates in the most "obvious" way possible: by painstakingly describing the algorithm in clear pseudocode. Even novice programmers will recognize that the program should find and print prime numbers up to a given number (as specified on the command line).

But novice programmers especially know that mistakes are often made in translating pseudocode to real code, often resulting in programs with unexpected and confusing output. Clearly, the program contains several syntax "mistakes" (e.g. LessThanOrEqualTo) and blatant "errors" (e.g. Zero). This program clearly requires "debugging."

As a result of these "bugs", the program does not calculate primes at all. Instead, the program reads input from stdin and returns garbled text on stdout. Fortunately, you can recover the original message simply by running the program a second time. Try:

./primenum n < textfile | ./primenum n > textfile2
diff textfile textfile2

where n is the same number (modulo 64). So, the prime number generator is actually a simple text encoder/decoder! Of course, don't forget that argument, otherwise the "bugs" in the program will cause it to crash!

Features

  • The program attempts to mislead the reader into thinking that it generates prime numbers. It does this by:

    • describing a correct algorithm in pseudocode;
    • using partially correct conversion of pseudocode to real code;
    • using suggestive variable names; and
    • using a suggestive program name.
  • The program demonstrates a novel method of abusing the C preprocessor.

  • Determining how the filter algorithm works is left as an exercise to the reader.

  • OK, so running it through the preprocessor strips away the prime number front. But ye be warned: "not a11 variab1es1es are identica1" :-)

  • Other features include

    • useless variables
    • useless if
    • a for loop that's used as an if statement
    • dependence on the high bit being 0
  • Try also echo THIS MESSAGE IS IN ALL CAPS | ./primenum 32

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/