This compiles the C pre-processed version as it seems like this will be
useful to any person crazy (by which I mean bold) enough to try and fix
it (and I give much respect to them!).
It is compiled by make all: maybe this is a mistake but it seems like
it's going to be useful if anyone is to fix it. This part can be undone
of course.
Format fix in README.md.
Add cpp.c which is the C pre-processed version cleaned up and somewhat
commented as it heavily (ab)uses the ternary operator and recursion.
Probably futile but it gave me something to do even if it was a waste of
time (could have worked on other README.md files or a host of other
things). This did indeed take a long time and a lot of effort!
Updated bugs.md with more hints about this entry. I explained here how I
came up with the C pre-processed version as it involves something of a
hack because of the complicated build instructions.
Updated anonymous.ten.c: #include <stdio.h>
Added anonymous.ten rule to Makefile.
Also disabled optimising level as the author stated that this makes it
slower.
I observed that the author is anonymous and yet the author information
shows the country. I'm not sure if this is intended or not.
Format fix 2001/cheong/README.md.
Roll back one of the fixes. INABIAF :-) The only fix necessary is
letting it work with clang. The feature is in bugs.md (will likely crash
without an arg).
Update dead link in README.md, winners.html and winners.csv. He has his
own domain now (was at university). I was able to verify it's his
website even though he didn't mention the IOCCC because he also referred
to the university he went to which we knew.
No longer refer to the university in the README.md file either.
The segfault fix (that prevented it from working at all) that I made a
while back was not actually complete. It should work fine now (famous
last words but it does appear to work now with different values where it
crashed). Some ints were used as pointers (including a function
pointer).
It should be noted again that 2000/bellard itself does not work but
having this program bug fixed will be helpful for anyone who might want
a crack at fixing bellard.c (see bugs.md).
README.md format fixes.
Update bugs.md with a note that the author used gcc 2.95.2 with a link
to the download of that version at the GNU gcc website. This was also
added to the top of the README.md file.
There were many many README.md files with the wrong heading level for
different sections. These have been changed.
To help go through the changes it should be noted I used sgit and also
here is what is changed:
The 'Try', 'To build' and 'To run' lines have two '#'s. Some had one and
others had three.
An exception is that in 1984/anonymous/README.md for the alternative
code that had three '#'s. This is not consistent yet and it might be
that only two are desired. But for now that one at least has three.
For Makefiles that have alt related rules, moved
the related rules under the alt rule section.
In some cases where there is no alt code,
removed alt rules and/or targets.
Simply the Makefile header.
Refer to the //www.ioccc.org/bugs.md URL (that will eventually exist).
Now using CC BY-SA 4.0 License to how you may share and adapt the
Makefile.
This still crashes and may very well not work even if it doesn't but I
cannot determine that. I just fixed the initial segfault when opening
the file. I believe it will take much debugging, a 32-bit system to test
it on and also a knowledge of the ELF format. There might be other
things but I believe those are the minimum requirements.
I did fix the supplementary program bellard.otccex.c so it does not
segfault and seemingly it works too (I didn't really evaluate that the
output is correct but it does process the args anyway).
I updated bugs.md to note that this entry does not work and any help
would be appreciated.
Add to anonymous/.gitignore 'anonymous.ten' as that's the example
program to be used for the entry (to those who want to try and fix it).
Minor fixes to three README.md files.
This unfortunately does not include making this work in modern systems.
I have used the cpp and I have had some ideas but I don't have a system
where I can test any fixes so it's probably not going to be done by me.
Nevertheless I have fixed the formatting of README.md, noted that it
doesn't seem to work (Yusuke Endoh came to the same conclusion) and also
fixed a typo in anonymous.ten.c (which 'sings' the wonderful English
counting song Ten Green Bottles .. or at least the theory is it's
English).
This entry has been added to the bugs.md file and I have provided a
number of hints that might (or then again might not) help for anyone who
is brave enough to try fixing it.
As far as the change to anonymous.c itself: I simply added some #includes
for functions that are used.
The main link was dead but looking at the Internet Wayback Machine I
found that he changed domains and it's still valid. One entry had a
different URL but with a quick check I could not determine that it had
anything to do with him so I changed it to his own domain (which I
verified is his).
The 2001/westley/.gitignore was also updated as it has other source
files that are generated by the commands in the try section.
This was done by changing the types of the args in main() to be int and
char ** respectively and (where necessary) casting the argv (V) to int
which was the previous type.
I also noted that prior to and after the fix certain invocations
segfaulted though Yusuke Endoh did not have this problem (I linked to
his analysis of the entry).
It became obvious when I actually looked at the code (though I suspected
from output that it was using ANSI) that it was just no longer valid
ANSI escape sequences. Yusuke Endoh made a patch which I used (I have
used ANSI before but it's been a long while). Yusuke guessed it was a
linux thing (reasonable guess) but this also works for macOS. Thank you
Yusuke for your assistance!
It unfortunately does not work well with the macOS default terminal
emulator (didn't test others). I also noted how one should use 'q' to
quit or else the terminal will be insane after you exit (which often
goes - I did say how to restore the terminal sanity too).
I had to make a new function (also four letter word to match the
formatting) that is allowed to have an int as the third arg to it. I
chose the word pain :-) as it's a pain that clang is this way without
providing any option to disable it.
Note that the arg must be an even number of digits. This threw me off
until I read the README.md because on different systems I got different
results for odd number of digits args despite the fact there should be
no difference here as the diff shows.