Files
ioccc/2014/wiedijk
Landon Curt Noll 11dfe51c6c move IOCCC Quick Start Guide
Created `quick-start.md` to hold the FAQ 0.0 content.

Used `sgit(1)` to change:

* faq.html#enter ==> quick-start.html#enter
* faq.html#enter_questions ==> quick-start.html#enter_questions
* faq.html#step_0 ==> quick-start.html#step_0
* faq.html#step_1 ==> quick-start.html#step_1
* faq.html#step_2 ==> quick-start.html#step_2
* faq.html#register ==> quick-start.html#register
* faq.html#step_3 ==> quick-start.html#step_3
* faq.html#step_4 ==> quick-start.html#step_4
* faq.html#step_5 ==> quick-start.html#step_5
* faq.html#step_6 ==> quick-start.html#step_6
* faq.html#step_7 ==> quick-start.html#step_7
* faq.html#step_submit ==> quick-start.html#step_submit

Via:

```sh
sgit -e 's/faq\.html#enter/quick-start.html#enter/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#enter_questions/quick-start.html#enter_questions/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_0/quick-start.html#step_0/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_1/quick-start.html#step_1/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_2/quick-start.html#step_2/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#register/quick-start.html#register/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_3/quick-start.html#step_3/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_4/quick-start.html#step_4/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_5/quick-start.html#step_5/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_6/quick-start.html#step_6/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_7/quick-start.html#step_7/g' '*.md' '*.hdr' 'inc/*.html'
sgit -e 's/faq\.html#step_submit/quick-start.html#step_submit/g' '*.md' '*.hdr' 'inc/*.html'
```

The former FAQ 0.0 section in `faq.html` now just refers to `quick-start.html`.

Modified menu and non-JS menu so that "Enter the IOCCC" refers to `quick-start.html`.

Changed `bin/gen-top-html.sh` VERSION from "1.4.10 2024-11-23"
to "1.4.11 2025-01-09".

Performed `make www` on macOS to complete the above.
2025-01-09 23:11:43 -08:00
..
2025-01-09 23:11:43 -08:00
2020-12-30 16:57:03 -08:00
2023-07-06 21:49:38 -07:00

To build:

    make

To use:

    ./prog

Try:

    ./try.sh

By default that will use indent(1) found by the shell type -P indent and sed(1) found by the shell type -P sed but if you want to change these, say to try a different beautifier, you can do it like:

    INDENT=bcpp ./try.sh

which would change it to use bcpp(1) instead of indent(1). Do similar for sed(1) only use the name SED.

Judges' remarks:

C11 features definitely help this entry to be as concise as it is.

The judges would like to think that they had almost understood how this entry works.

If you win a bet by demonstrating this entry, please let us know.

Author's remarks:

Remarks

  • Computes the factorial function.
  • No loops, no explicit recursion.
  • Untyped C without any casts, using a w word datatype.
  • Varargs not essential, w(*)(w,w*) works just as well.
  • Conforming to ISO C.
  • No warnings when compiled with -std=c99 -Wall -Wextra -pedantic.
  • Comments in the code explain what this really is about.
  • C as a functional programming language: untyped lambda calculus compiled to executable C functions.
  • Untagged closures (just a function pointer followed by some values).
  • Recursion implemented through Curry's paradoxical combinator Y.
  • The readable implementation of Y is on lines 29-30:
    W_f = \x.f(xx)
    Y = \f.W_f W_f
  • A mixture of strict and lazy evaluation, with a _ force function (John Tromp notes that if Turing's fixed-point combinator (\xy.y\z.xxyz)(\xy.y\z.xxyz) had been used, all applications could have been strict).
  • Uses Y to implement factorial on native ints.
  • 10! seconds = 6 weeks.
  • Answers the ultimate question of life, the universe and everything.