Typo fixes in 2005/sykes/README.md.
In chia/chia.c I changed uber to über to be correct (ueber also would
have been okay). It's in a comment so I don't see it as a problem but
let's just say that if it is I'm above it! :-)
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 includes for the X11 header files omitted the X11 and this means
running make will fail even if one has the files in a place that's in
the include path (default or via -I option).
Of course if one has X11 include files in a non-standard location (or
where the compiler doesn't look) they'll still have to use the -I
option.
main() had one arg, a char *, and this is against clang requirements.
There was no inclusion of setjmp.h and so the longjmp() function
implicitly returned int and was allowed to take the wrong number of
args. It should return void however and this caused a problem with
binary expressions. The comma operator has been used for this but it
might be a problem in that by having ,1 after each it will make
expressions that could turn out to be false to be incorrect.
The longjmp() was being called with one arg which was an element of an
int[4][1000]. This is obviously incorrect but at some point it worked.
Without the prototype this is not a problem but both before (gcc) and
after the compiler fix (with gcc and clang) it did not work with linux
(in this case fedora) or macOS. The code as it now stands has the same
problem as it did before the compilation fix: it lets you input a bet
but then it does not accept any input after that; it prints nothing more
but it should print a new hand. This issue has been put in bugs.md.
My guess (in my tired head) is it has to do with the abuse of the
longjmp() and/or the comma operator making the expressions always 1 (at
least that side of the expression, thus if it gets to the longjmp() part
it will always be 1). Perhaps it should be ,0? I don't know but I might
try that next (I would guess it should be whatever an implicit int would
return without a return statement but that's just a guess). But given
that it stops working at the same spot perhaps it's not the comma
operator. Maybe the function needs to be broken up into several but I
don't know and that might or might not be worth the effort.
Finally it returned main() itself but now it returns poke() which has
the body of what main used to be.
See bugs.md for more details.
Landon and I both individually fixed it to work with clang. It appears
that both work just as well but I made it so that the argv (now ll, was
l) in main() is not the name of a function that is defined earlier in
the file. Although Landon's fix worked this felt like a better idea
especially as it seems like the argv he made was not referenced in
main() but it should be.