As I explained in the index for IOCCC 26 even though I did not win there are two entries I wanted to show because they cannot be improved and yet I found them interesting though of the two I am publishing in their entirety this is far less interesting from the other one for me.
This is how it transpired. When trying to come up with an interesting idea for an entry I had at first thought of making a one liner entry. I decided against this but I had the thought: what if there is a program that would act much like wc(1) but with the following changes:
- Based on the current IOCCC 'definition' (maximum) number of octets and lines for a one-liner say yes or no: as in would it fit? It does not verify that it is a valid C program or even C at all but it simply determines if each of the files is (1) one line (but see below) and (2) no more octets than is specified currently (120); both of these are definable at the compiler. This means that you can also test if it's a 5 line program with no more than 70 octets. This is simply to make it more customisable.
- Whereas wc(1) under Linux has the -L option which prints out the length of the longest line it does not under macOS; this entry does: as well as the other fields that are printed under Linux only that the fields are always printed (in the same order as wc(1) does).
- Finally because the IOCCC judges love prime numbers I decided to have the entry mark each number (count) with an asterisk (a '*') if it is a prime number. But because the judges are very pedantic about prime numbers and accuracy and because I took an algorithm for prime number determination (but did what I called C-ifying though in the past this was only C++ to C; this was if I recall correctly Python) I decided to place the blame on the code I had found so the judges could not say that my code was wrong! I did similar to this in other ways possibly in this entry but I do not recall completely.
In the remarks.markdown (opens in a new tab/window) I write about how there are variations of prime numbers in the source code as well as the remarks file and some arithmetic based on the current year (and maybe some other things). I was quite impressed with what I came up with though the really cool one was the entry I am at this time not publishing. Otherwise there is a tarball of the files here and the individual files can be found here. And no: I do not expect anyone to really look at any of this at all but I originally had the idea that I might put some of the losing entries here too (this was thought last year).