The sections have been modified a fair amount. The Entries menu has been extended to have: Fixing entries, Updating author info, Thanks for the help. The first two were moved from FAQ and the last one from About. The rationale for these, in order: entries and authors have to do with entries and most of the help involves entries. It also has to do with website but in 'about' it does not seem the right place, unless maybe it is renamed to 'Credits' or something (I am not suggesting this one way or the other). This one is debatable but that was the rationale. The Status menu has been extended to have: Markdown guidelines and Security policy. The rationale is that the markdown guidelines are part of contest guidelines and the security policy is about the status of the entries and how if there are any security problems they will not be addressed (instead of about the IOCCC). The FAQ was extended to have: Compiling entries, Running entries, How to help. The reason to not have compiling and running entries under Entries is because this is 'how to' and also the menu was too long. How to help seems like a good idea under FAQ too (was in About). About was extended to have the new 'about.html' page (from about.md). This is a rare case where a new file is useful as it fits under 'About'. The menu now is: Home page, About the IOCCC, The Judges, Contact us. I was pondering the 'About [the IOCCC]' at the top and also naming it 'About us' but it seemed like a link to index.html was necessary and as for 'about us' it seemed less clear as to whether it was about the judges or the contest itself. The FAQ has been updated slightly for this. After further inspection the bin/index.html and the inc/index.html links were removed from the about section. With these changes, renaming an item or slight reordering notwithstanding, I believe that #2006 is probably in good shape.
To build:
make all
An alternate version exists that fixes a bug.
Bugs and (Mis)features:
The current status of this entry is:
STATUS: known bug - please help us fix
For more detailed information see 1992/albert in bugs.html.
To use:
./albert number
Try:
./try.sh
Alternate code:
An alternate version of this entry, albert.alt.c, is provided. Leo Broukhis, before he was an IOCCC judge, sent the IOCCC judges this Email message:
From: leo at zycad -dot- com (Leo Broukhis)
Date: Tue, 30 Jan 96 17:37:51 PST
To: judges at toad -dot- com
Subject: IOCCC 1992 - a bugDear Judges,
albert.c(even in its fixed form) still has a bug. Although I don't remember the number that exposed the bug (afair, resulting in coredump) inalbert.orig.cthat has been fixed inalbert.c,I've found a number exposing another bug: 10000000001 (that's 9 0's). Both albert and albert.orig loop without printing anything, although the first factor is 101 and is usually found in an instant.
The albert.alt.c file is the fixed file, whereas the albert.c is the file before applying Leo Broukhis' fix.
Alternate build:
To compile this alternate version:
make alt
Alternate use:
Use albert.alt as you would albert above.
Alternate try:
./try.alt.sh
Judges' remarks:
We were impressed with the speed at which it was able to factor arbitrarily large numbers consisting of factors that fit into a long.
Author's remarks:
The Obfuscated version of the Horst algorithm.
This program will factor unlimited length numbers and print the factors in ascending order. Numbers of one digit (e.g. 8) are rejected without notice.
It quits as soon as there is at most one factor left, but that factor will not be shown. It accomplishes this efficiently, without resorting to division or multiplication, until the candidate factor no longer fits in a signed long.
The nicest way is to rename the program into e.g. 4294967297 if you want to factor Fermat's 4th number. Then just run it.
Or you may type ./albert <some-number>
A nice one is also (30 ones):
./albert 111111111111111111111111111111
Apart from the foregoing there are no special execution instructions.
To customize the program into a factorizer of a fixed number, use
cc albert.c -o 4294967297
or some such.
There are no data files used, and it is not possible to feed input
via stdin.
I think this program is a nice example of algorithmic obfuscation. Several times two similar algorithms are merged into one. Then you need quite some tricks to get it running, such as long jumps through recursive subroutines. I felt like a sword smith, welding the sword very long, folding it again to the proper length, keep on hammering till it is tight, then fold again. Always keeping it at the proper red hot temperature, but not too hot lest the hardness fades.
The strict naming conventions for subroutines did not make things much clearer after all, but it was not supposed to.
I would like to draw attention to the robustness of the program with respect to error handling and the nice stopping criterion. The aesthetic appeal of some lines is at the expense of clearness, I apologize.
Running the program through the C-beautifier reveals nothing, it will only destroy some of the lay out. Running the program through lint shows the usual remarks for a K&R program. Defeating this through casts does not make a program cleaner in my opinion.
Hints
Here are some hints, but they may not be too helpful:
- The Horst algorithm is described in the Hobby Computer Club Newsletter, year 82, part 4, a real Dutch treat. Assembly, C and Forth version have been around for some years.
- Does fractal programming exist after all?
- You remember the Toom-Cook algorithm in Knuth? It uses iteration instead of recursion and is quite jumpy. This program shares these disadvantages in a modified form.
- The Conversion is to be found in Knuth, not so the Observation. The Observation: "if it ends in a zero, it is divisible by ten".