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.
In all versions the program would segfault if the file could not be
opened as it would write/close the NULL FILE *. Now it doesn't act on
the file unless f != NULL. If it is it just does the usual of writing
'Ok' to stdout.
The Makefile had -include stdio.h which made it fail to compile under
macOS (mismatch type of fopen()). I removed the prototype in the code.
I also made it use fgets() instead of gets() to make it safer.
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.
The example commands in the judges' comments had some problems that gave
an error message when running them.
I have also figured out the apparent problem with macOS in the command
under the try section being:
echo "Quartz glyph jocks vend, fix, BMW." | compress | ./btoa | ./jaw
But it's not actually a problem. It uses perror() and under macOS with
errno == 0 it shows:
Undefined error: 0
whereas linux shows 'Success'. So it's not actually a problem with the
entry at all. In fact the condition that triggers that call is the same
in both linux and macOS.
I've updated bugs.md to note this and I also updated the README.md to
note it (and to refer to the bugs.md file for more details).
The thank you to me is because I missed it earlier on when I fixed the
scripts, simple though the fixes were.
In the README.md I explained the difference in case someone wishes to
change the fgets() version back to gets(). I decided to not make it an
alt version as it was discussed that usually there should not be an alt
version.
The segfault has been fixed when EOF is sent to the program (causing
fgets() to return NULL).
Since fgets() is far safer than gets() and since the gets() version will
intersperse the warning and the first line of output I have changed the
alt version to be the original (fixed to compile with modern compilers)
and the tbr is the one with fgets().
This is so that the warning about gets() is not interspersed with the
initial output of the program (see below). I do want to note that if one
sends EOF it will segfault so to exit one should do ctrl-c (for
instance) (exit never worked). I will look at fixing that fault later on
to match the original code but this is good for now. When fixed (low
priority though) I will consider making the gets() version the alt but
probably not (I guess time will tell).
As for the interspersed output it looks like:
$ warning: this program uses gets(), which is unsafe.
# cursor is here
At the cursor I can either hit enter to get another prompt or I can
input a command but this is not immediately obvious.
Updated .gitignore to have tbr.alt.
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.
In some files changed the formatting was fixed to be a proper markdown
file.
There were some typos including that some README.md files that linked to
/winners.html#Cody_Boone_Ferguson actually linked to the non-existent
file /years which obviously would not work.
I also added links to the rest of the places I have fixed entries (but
see below) and I did the same for Yusuke Endoh's fixes.
As well apparently one entry I thought he fixed to compile under modern
systems does not seem to so that entry will have to be revisited another
time. That entry was 1993/jonth.
Those are the main changes here if not all of them.
As was discussed with Landon this was a mistake even if it helped with
consistency. There was even a brilliant pun that was destroyed with that
commit which I think is worth pointing out:
cp README.md hill
./ant hill
in 1991/ant ... even if it's technically 'anthill'.
I hope that I got all links fixed in years.html and winners.html. As
well I tried to make sure I got all handles fixed in all/summary.txt.
Nevertheless these should be checked. For some handles they were never
updated (at least in the html files - though maybe summary.txt too, not
sure) in the first place so there was nothing to do.
Typo fixes like references to *.hint when it should be README.md. There
probably are others that need to be fixed but haven't been located yet.
Add thank you note to Cody in some README.md files, remove the warning
that 1990/westley/westley.c might not compile with modern compilers
(since I fixed it) and reworded a statement slightly. Yes I'm thanking
myself but it's actually from the judges.
There were many files renamed in this commit and I hope I got all the
references to the old names changed to the new names. To explain this
commit there were some older entries that had the wrong directory name:
not the surname but something else.
Very possibly there are other directories that need to be renamed and I
am actually aware of one right now but since it's in 2005 (which is
close to being worked on) I am not changing that now but just noting it:
2005/anon should be changed to 2005/anonymous (unless there's a very
good reason I am unaware of). But like I said since 2005 will be worked
on soon I have not touched it.
The Makefiles, .gitignore, the all/summary.txt, years.html and
winners.html files as well as the directories and the files under the
renamed directories have all been updated.
This is a rather big update and it might be that there are conflicts. If
so I will fix them. I will have to update 2005/anon later on to try and
prevent this from happening but very possibly there will be conflicts
here. It's also possible I missed some changes in years.html and/or
winners.html and/or summary/all.txt but I think I got them all. These
should be verified later on.
Although I previously got them to all compile they did not all work. Now
they do except that jaw does not work properly in macOS (I have noticed
something odd in linux too but it appears to work mostly if not
entirely).
Yusuke Endoh pointed out for 1990/theorem that atof() nowadays needs
include stdlib.h so this was added to the file. As well I added the
inclusion of string.h for strcmp(). I also fixed some segfaults in this
entry (even though the judges pointed out that for NULL pointer one
needs the four '0 0 0 0' it still segfaulted under those conditions) so
that everything should work now under both linux and macOS. There were
iirc two parts to this: one the NULL pointer is no longer dereferenced
but also the type being passed to strcmp() was a int * and not a char *.
This prevented 1990/theorem/sorter from working at all (segfault) and as
I recall it there was another segfault I encountered as well.
For 1990/jaw Yusuke Endoh provided a ruby implementation of btoa as it's
not always available in modern systems. Thank you Yusuke!
In 1990/jaw shark.sh had to be modified as well. This had to do with '.'
not being in the default PATH.
As well I had previously made a mistake about btoa versus atob as both
were referenced in 1990/jaw/README.md. I believe I have this correct
now.
Many if not all the README files were modified with various changes
including formatting (like turning them into markdown) and section
titles amongst other things.
I seem to recall I'm missing something here but I can't recall what I
recall :-) so this will have to suffice this time round (maybe it was
the btoa/atob issue that I just remembered and added above but I'm not
sure).
Move copyright notice to the end.
Add a standard comment about the newly added `README.md` files.
Clean up trailing whitespace.
Fixed a few minor typos.
My first 41st, 51st and 29th (all depending on the base) birthday
updates (possibly more will follow but this is not a certainty). All the
1990 entries now compile!
In one we used a patch from Yusuke Endoh (thank you Yusuke!) which we
credited him in the README and in another we used a tip from him (use
-ansi at the compiler line) to get the other to compile (again, thank
you Yusuke!). We fixed the others. In the case of 1990/tbr/tbr.c the
author had supplied a shorter version and we fixed that one too.
Added 1990/.gitignore which has the built files of 1990 so that after
doing `cd 1990 ; make all' running `git status .' will not show any
untracked files.
Added Makefiles for 1990 entries.
In a some cases the source code was modified.
Modified 1990 README.md files.
In some cases the program still cannot be compiled.
Depending on if it was the beginning of the sentence the EMail would
become 'Email' or 'email'.
Some references of 'Email' were changed to 'email' as well as those were
not in the beginning of a sentence.
A few places some consistency of capitalised email address (made lower
case) were changed to match other places of the same pattern.
There is one exception:
$ find . -name '*.hint' -execdir git mv '{}' README.md \;
git statufatal: destination exists, source=1992/albert/albert.hint, destination=1992/albert/README.md
Looking at the two files they differ quite a bit so I've not changed it.
I'll bring this up on GitHub.
We we move 1988-2004 entries from all of a year's winning entries
in a single directory to each winner being in their own sub-directory
under the given year directory.
The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.
One will find HTML commented out with:
<!-- XXX remove when 2020 is ready
2020 links here
XXX remove when 2020 is ready -->
The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks. Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known. The following files
have such HTML comment blocks in them.
./winners.html
./years-spoiler.html
./years.html
In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.
The 2020 winner code AND write-ups are NOT part of this set.
p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).