Adjusted `inc/md2html.cfg` to improve the 3 phase parse process.
Added `tmp/sample_getopt.sh` as a demo of the 3 phase parse of command
line options and arguments for that a markdown to HTML tool that
uses the `inc/md2html.cfg` configuration file.
Try:
```sh
cd tmp
./sample_getopt.sh -v 3 foo
```
The `tmp/sample_getopt.sh` tool performs a somewhat complicated 3
phase getopt parse of simulated command line options and arguments
that a tool converting markdown to HTML and using the `inc/md2html.cfg`
configuration file would perform. The tool does not actually use
the `inc/md2html.cfg`, it just simulates the complex 3 phase getopt
parsing procedure.
Updated `tmp/README.md` accordingly.
Because of the nature of 1988/spinellis, we cannot compile
the entry directory. While there may be workarounds to
automatically compile code that tries to read source from
standard input, such workarounds are likely not portable
or at best uglify the process.
NOTE: This entry should NOT use a `try.sh` nor `try.alt.sh`
approach. Instead the user needs to be directed to perform
the actions. We do this by echoing instructions from the Makefile.
We remove the entry line from `input.txt` and `input2.txt`
to make the echoed instructions in improve the clarity
of the echoed instructions.
We turn off all warnings, due to the fact that whatever
the user might enter might have minor issues. As such,
and to be similar, we turn off all warnings to the compiled
commands just in case compiler writers or ANSI C does
something silly in the future. ;-)
We clean up `make clean`, `make clobber` as well as
updating and sorting `.gitignore`.
The spoiler.c was also renamed to vanschnitz.alt.c and the Makefile was
updated so that running make alt will compile it. The Makefile also now
has -Wno-implicit-int.
The README.md file only had 'Alternate code' and no subsections for how
to build or use the alt code. This is because I had already gone through
this year before we changed the way to present alt code.
The try.sh script checks that the terminal size is large enough for two
files, the prog.c (last check) and sample_input.txt (provided by the
author). If it's too small for either it exits as it can't work. The
added ioccc.txt is very short in column and rows so that should not be a
problem (except in very extreme cases?).
The sample_input.txt file had trailing newlines removed because it
showed differences in output otherwise (and shouldn't).
The bugs.md was updated - add INABIAF for this entry.
Format/typo check README.md file.
The save state option is based on the author's remarks that one can
change the W macro to MAP_SHARED. This is defined in the Makefile so a
variable called 'SAVE' was added which if not 1 will result in
MAP_PRIVATE. This way one can run
make clobber SAVE=1 all
and it'll save state, assuming that (if you add a file) you run 'sync'
before exiting. If you don't run sync(1) it's likely the file won't
exist or it'll be corrupt (like a.out from mullender.c). README.md file
updated for this update. Note that the setting the W macro to ${MAP} is
only done for the make targets that had it set to MAP_PRIVATE. This is
because I guess that if it's already set to MAP_SHARED in the Makefile
there is a good reason for this. This is noted in the Makefile.
The bug I discovered happens whether or not state is saved (this had to
be verified before I did the above change that I added when I was
working on this entry some days back but never committed it for this
reason). If you run ./prog and then exit (ctrl-e) if you then run ./prog
again it'll show a strange message as if the image was corrupt. You have
to hit enter at this point (that's important) and then hit ctrl-e again.
When you run it a third time it'll be okay. I did not look at this in
detail but it probably should be fixed.
The Makefile also tries to make the note about preserving images to be
the state of the file (downloaded) at the time the entry won and how any
updates are unofficial stand out more.
This file is from my copy from the preview period of 2018 but that
somehow was missing. I had added this to /2018/README.md but this was
not carried over to the archive tarball.
In this entry it could have been interpreted as the author provided the
try.sh script too rather than just the alternate code (which they did
provide but I put in the alt source code file).
The question for FAQ 5.6 was improved to be more compact
while addressing both broken and wrong web links.
Removed any direct reference to drugs in an effort to
avoid problems from those who are humor impaired,
as well as "bots" to might flag the site as connected to drugs.
Moved the reference to the tool used by Cory to find
broken links to the thanks page.
Updated Makefile so one can easily change the 'Z' macro by doing:
make clobber MEMORY=... all
This is not usually useful but there are occasions where it is. As the
README.md points out this value must be a power of two!
The try.sh script runs the program on a number of the mc files, first
showing the input keys as a reminder (it also reminds one to keep in
mind the focus of windows).
The bugs.md is updated to note that it uses gets(3).
Format/typo check README.md file.
I changed the number of years ago that microorganisms appeared on Earth
as the number was off: there are those wondrous hydrothermal vents that
spewed mineral rich waters. Fun fact on the history of the Earth: did
you know that as of 2013 the number of years since the dinosaurs were
wiped out is not 65m years but actually 66m? That means that if you were
born before 2013 and you didn't die right before the revision that
you're in a rare group of people who have had a major historical update
as far as the dinosaurs go. But don't let it get to your head too much!
It also means you're ancient, possibly even a dinosaur, and you're
headed their way. :-) That's the price we must pay for being in that
group.
... and what one should do, of course. This includes an example of an
invalid link (albeit an extreme one :-) ) that I fixed quite some time
back (months ago) just to give an idea. But it's more useful to check
for dead links in the IOCCC website itself (linking to pages/files in
the website that is). Of course I'll be doing that once the README.md
files are in order but there's a high chance I won't be able to find
them all esp as after the website is done I have more to do.
Before doing 'diff -s sha512sum.txt prog.txt' it does a cat on both
files (in one command) so that one can see what is being compared
(or to verify what is being compared).
The try.sh script looks for sha512sum and shasum. If either of these are
found it will use the one found (in the order of sha512sum first and
shasum -a 512 second) and prog. If neither can be found it uses just
prog. If one of them can be found, however, it shows how the output is
the same.
The prog.c was restored from prog.orig.c. Like 2019/diels-grabsch1 the
purpose is no longer valid and even more problematic is the fact that
the checksum value obviously would not be correct otherwise. Makefile
updated instead.
The README.md file has been format/typo checked.
.gitignore updated - added files that try.sh script uses (though it does
delete them after use).
Add Shakespeare.txt from 2019/mills. This was used in the try commands
(now try.sh) by doing cd ../mills ; make ; cd ../diels-grabsch1 but this
is problematic because it requires that one has the same directory
structure. Even more than that there's talk about having a tarball with
each entry by itself so the text file has to be in this entry's
directory too.
The prog.c was reverted back to the original source code and the
Makefile updated to have a -Wno- option. Originally the idea was to make
the author's remarks true that even -Weverything of clang shows no
warnings (which certainly did at the time) be true. I had the thought
that it would be nice to keep CSILENCE empty. But this was bordering on
going too far and more recent versions of clang have yet another dubious
warning and it seems that that warning one cannot even prevent (but
doing so here would obviously not be okay) so if that is silenced it
would mean that CSILENCE is no longer empty anyway. This way is better
anyway as the code is now the same. Of course the statement by the
author that a certain paragraph in README.md is the same shape and size
as prog.c is no longer true but that can't be helped.
Format/typo check README.md file.
I'm almost positive that my earlier fixes to the scripts for the other
languages was all that is needed and the reason they don't work is due
to the dictionary and the fact that in some languages it is hard if not
impossible to form perfect pangrams especially with the entire alphabet.
This appears to be the case with German. A point of interest that I put
in the German scripts is:
# Are the umlauts ä, ö, ü and Eszett (ß) letters in the German alphabet? There
# is more than one opinion on the subject but a lot of words do have an umlaut
# (or Umlaut in German). In some (probably all) systems this script outputs
# nothing probably because it's very hard to form a perfect pangram in German,
# if it's not impossible. Nevertheless, we do include the other characters
# whether or not they are in your view considered part of the alphabet for the
# reason that so many words have them.
I put it 'if it's not impossible' because this also depends on what
letters are provided. These scripts give the entry every letter,
however, including those with diacritics so in the case of German it's
not going to work. It is possible to make it work if you remove some
letters or you give a word that has all the letters (but that kind of
defeats the purpose). As for the other languages I don't know if it's
possible or not (and I'm not fluent in German either - I just know
some). A search suggested it's possible in some other languages but the
author noted it's not in Spanish at least according to their estimates.
Nevertheless I believe that the fixes I made are all that's needed so
this entry now has INABIAF in the bugs.md file.
Fixed the Makefile so the alt version would actually build. Added
scripts to use the alt version instead.
Format/typo check README.md file.
Added try.sh and try.alt.sh.
Downloaded and converted the PS file linked to by the author to PDF and
added to repo.
The try.sh runs prog and wc side by side but in a way that is formatted
(including alignment) so it's easier to see what line is from which
program and it also runs make test.
The script cow was renamed cow.sh to help browsers with whether or not
to display or download.
The script check was renamed check.sh to help browsers with whether or
not to display or download.
The script check.sh was fixed in case the 'x' (passed in to the script
as an environmental variable) is not executable (it resets it back to
./prog) and also made to satisfy ShellCheck.
The script cow.sh was fixed for ShellCheck moo (or was it too? :-) ).
The crash.unl is what the judges put in their remarks (and at the end of
the file they say more). It was added so one can see what is meant.
Updated bugs.md for this - INABIAF.
The try.sh script is as usual.
The README.md file has been format/typo checked.
Using 2018/mills (an amazing entry) with trial and error I was able to
determine the approximate speed that the :-) moved across the screen and
now the alt code moves at almost exactly (I believe, at least) that
speed.
The mullender.alt2.c was deleted; instead that became mullender.alt.c.
This is because (I believe but have not confirmed) that the original did
not exit after it timed out and there's no need to have two alt versions
when they're so similar. One is good enough and the obvious choice is
the one that can keep going on.
.gitignore updated.