This is a large update that modifies every .entry.json file and fixes
many others. The changes of every .entry.json file are as follows:
- change 'entry source' to 'entry source code' [0]
- change 'original source' to 'original source code' [0]
- change 'directory path from top directory' to 'directory path from top
level directory'
[0] This is for consistency purposes. Other options were pondered but as
the index.html files refer to 'Alternate code' this was the simplest way
to go about it and it also feels more natural. A question was whether to
have 'entry code' and 'original entry code' or to have the word 'source'
added to it but I decided upon including the word 'source'. Another
question has occurred to me is whether or not 'original source code'
should instead be 'original entry source code' but that can be decided
upon later as that occurred to me after much of the files were already
rebuilt. The consistency that this commit has made is for the README.md
sections and in particular 'Alternate code'. One might wonder if that
should be changed to 'Alternate source code' as now the manifest
includes 'source' in the 'entry code' and 'original code' but the
manifest itself is what was actually updated and having 'source' feels
more natural for submitted files. After all not all entries have
alternate code. These questions can be decided on when looking at the
index.html files that have been rebuilt.
Changed 'alt code' to 'alternate code' where this was not already done
(in the manifest). It is questionable whether this should be done in
markdown files or not (in the README.md files section it already is done
but not necessarily in other places).
Many files had incorrect descriptions that have been checked.
Renamed 2020/endoh2/spoiler/spoiler.{md,html} to index.{md,html} so one
can go to just 2020/endoh2/spoiler and see the web page. Although the
manifest of 2 020/endoh2/index.html will link to it and that's probably
how most people will notice it it seems useful especially as the web
page links to the different files in spoiler/ or at least refers to
them, giving a description (kind of like the manifest in
2020/endoh2/index.html).
Due to the above changes all the entries had their index.html files
regenerated too.
There were likely other changes and fixes as well.
What has NOT been done is a check over all items, typos or otherwise,
though some typos have been fixed. Nonetheless this commit goes a long
way to resolving issue #1933.
Updated thanks file both with a missing <div> id and added a manifest
improvements section as the manifest is quite important.
To build:
make
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 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!