Typo fix.
Rename COMPILING -> COMPILING.md and HACKING -> HACKING.md. I have not
tested the formatting on either of these but they should be okay.
Updated the COMPILING (portability information) as I know it works under
Apple M1 chips too.
The Makefile now chmod +x makegif.sh as it's referred to in the
README.md.
Change word 'Depends' to 'Dependencies' in makegif.sh to read a bit
easier.
Make README.md a bit easier to read (as English is not Ilya's first
language).
Made the command Ilya suggests to make GIFs so that it makes use of the
command the judges suggested, noting that it's just an example.
Added middle name to my name to match my name as a winner.
Of course if Ilya objects to any of this (or any other entry of his) I'm
certainly okay with rolling back the changes (same with his other
entries) but I believe that this will make it a bit easier to try out
the entry.
The Makefile referenced a URL that no longer is valid (or less valid?).
The README.md referred to shakespeare.txt but the file (extracted from
the file downloaded from the curl invocation in the Makefile) is
Shakespeare.txt (in some places it was capitalised).
There were some formatting fixes in the README.md file too.
There is a .gitignore added but not in this commit - an upcoming commit.
It has the two files in that gzip file added but since it also had other
files I've kept it for a separate commit. A question of whether the
files should just be part of the entry is another to maybe consider but
for now it's not.
In the check_be.sh script the default expected prog_be to be in the path
but that's not likely so make it ./prog_be instead.
Updated README.md to change prog.be to be prog_be and also add a note
about it segfaulting without an argument at the judges' comments, close
to the top.
The Makefile also warns on the entry segfaulting on no argument. This
way the viewers can have a warning. I will look at doing this with other
entries that might segfault too but later on.
I also added some example invocations to highlight something Dave Burton
mentioned in his remarks. Of course if he's against this I have no
problem there but I think it enhances the README.
There are many more fixes to be made but I wanted these in. Even the
files I have checked will have to be checked again in more detail but I
needed these committed so I could fix something in another file that
will need a new branch. More updates to README.md files will then be put
into yet another branch if the pull requests have not yet been merged
before I get to these updates (which really ought to be a lot of
fun! :-) )
With the exception of lmfjyh which relies on a bug in gcc (that was
fixed in gcc 2.3.3) we have got all 1993 entries to compile under linux.
A couple will not compile under macOS and this is because gcc under
macOS is actually clang despite what many might have you believe (see
below) which is more strict about the second and third arguments of
main().
In a couple entries we used patches from Yusuke Endoh. Thank you Yusuke!
In others we (that is I aka Cody / @xexyl) fixed them (myself). There
was a question to be answered about whether to add #include lines to the
files themselves or add -includes to the Makefile. Since there are
pending changes to the Makefiles which will affect the CFLAGS (and
there's no CINCLUDE variable in these Makefiles yet) we opted for
updating the source files themselves.
One more note about the Makefiles: the 1993/Makefile was modified but I
added an XXX note to it to indicate that it should be fixed once the
other Makefiles are fixed. Specifically it now allows from 1993 one
to run `make' and compile the entries. The comment has what it used to
read and should be but for now is not because of a problem in the other
Makefiles.
As far as gcc under macOS as you can see it is not actually gcc but
clang:
$ /usr/bin/gcc -v 2>&1|head -n 1
Apple clang version 14.0.0 (clang-1400.0.29.202)
If you were to use clang -v under linux you might see something like:
$ clang -v 2>&1|head -n 1
clang version 15.0.7 (Fedora 15.0.7-1.fc37)
and with gcc:
$ gcc --version |head -n 1
gcc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)
If you do by chance have gcc compiled and installed under macOS these
entries will probably work there.
Some of the links had to be manually updated (including by downloading
from the IOCCC website some missing files which I'm not even sure how
they were missing from the repo) and others were fixed via sgit. To
demonstrate its usage the following command removes from years.html the
patterns 'hint.html' and '\.hint' with tracing enabled and verbosity of
level 2. Notice how in this case the patterns are just deleted but one
could substitute it for something else or run other sed commands as
well. There was no need to specify sed options or the -I option (which
means don't use the -i option to sed). If this change needed to be done
in the entire repo 'years.html' could have been instead just '.' (if at
the root directory of the repo). One can specify more than one glob just
as one can specify more than one command (as of the bug fix in commit
05e83b60ff).
$ bin/sgit -x -v 2 -e '/hint.html/d' -e '/\.hint/d' years.html
+ getopts :hVv:xIo:s:e: flag
+ case "$flag" in
+ VERBOSITY=2
+ getopts :hVv:xIo:s:e: flag
+ case "$flag" in
+ SED_COMMANDS+=(-e "$OPTARG")
+ getopts :hVv:xIo:s:e: flag
+ case "$flag" in
+ SED_COMMANDS+=(-e "$OPTARG")
+ getopts :hVv:xIo:s:e: flag
+ shift 7
+ [[ -z -e /hint.html/d -e /\.hint/d ]]
+ [[ -z /opt/local/bin/sed ]]
+ [[ ! -f /opt/local/bin/sed ]]
+ [[ ! -x /opt/local/bin/sed ]]
+ [[ 2 -eq 0 ]]
+ git status
+ status=0
+ [[ 0 -ne 0 ]]
+ [[ 2 -gt 1 ]]
+ echo 'debug[2]: sed commands: -e /hint.html/d -e /\.hint/d'
debug[2]: sed commands: -e /hint.html/d -e /\.hint/d
+ [[ 2 -gt 1 ]]
+ echo 'debug[2]: looping through all globs'
debug[2]: looping through all globs
+ i=0
+ [[ 0 -le 2 ]]
+ [[ 2 -gt 1 ]]
+ echo 'debug[2]: found glob: README.md'
debug[2]: found glob: README.md
+ [[ 2 -ge 1 ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ echo 'debug[1]: about to run: git ls-files README.md | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d'
debug[1]: about to run: git ls-files README.md | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d
+ [[ -z '' ]]
+ [[ -n '' ]]
+ git ls-files README.md
+ xargs /opt/local/bin/sed -i -e /hint.html/d -e '/\.hint/d'
+ (( i++ ))
+ shift 1
+ [[ 1 -le 1 ]]
+ [[ 2 -gt 1 ]]
+ echo 'debug[2]: found glob: years.html'
debug[2]: found glob: years.html
+ [[ 2 -ge 1 ]]
+ [[ -z '' ]]
+ [[ -n '' ]]
+ echo 'debug[1]: about to run: git ls-files years.html | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d'
debug[1]: about to run: git ls-files years.html | xargs /opt/local/bin/sed -i"" -e /hint.html/d -e /\.hint/d
+ [[ -z '' ]]
+ [[ -n '' ]]
+ git ls-files years.html
+ xargs /opt/local/bin/sed -i -e /hint.html/d -e '/\.hint/d'
+ (( i++ ))
+ shift 1
+ [[ 2 -le 0 ]]
A problem existed where more than one command would not work (always or
in some conditions depending on the command: not sure which). This
prevented a fix in years.html which will be in the next commit. The sgit
repo has been updated with this fix as well.
The fix is to remove space from IFS and to change "${SED_COMMANDS[*]}"
to be "${SED_COMMANDS[@]}".
Make test.sh +x.
Formatting fixes.
Typo fixes.
Other things as well.
I'm actually aware of some other things that could still be done including
removing some text that is no longer needed (and some that probably is
not needed) but this can come at a later date.
There are some places where this was not done: in data files that refer
to binaries (examples being 2001/herrmann1/{README.md,herrmann1.c} and
those related to 1990/theorem for Turing and Fibonacci respectively). In
comments in code it was changed to be capitalised though this is
potentially problematic in that maybe it was intentional by the authors.
Now allows to not overwrite files.
Now allows sed options to be passed to sed.
Allows specifying path to sed.
This script now has its own repo at https://github.com/xexyl/sgit. I
don't expect many people to use it but it seemed like it was worthy of a
repo as it is a pretty handy script (though far from perfect).
New version of sgit.
Script now allows for spaces in sed commands. Thus one can do something
like:
sgit -v3 -x -e 's/web site/website/g' .
to set verbosity to level 3, turn on tracing (see below) and change
occurrences of 'web site' to be 'website'.
Also added -x option to turn on tracing.
This is because it is macOS and it's indeed what OS I explained how to
get the entry to compile under. It might not matter much but since we're
making things consistent (this same change might need to be done
elsewhere) and as correct as possible this commit seems good.
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.
Since the original program does not compile and more than one of us
fixed it (the judges and me and probably others as well) and the fix is
in stein.c we remove the stein.orig.c.
Updated Makefile so this would not be a problem. Updated README.md to
not refer to make alt.
Accidentally committed absolute path of sed.
Also it now shows the sed commands with high enough -v level. This is to
help with a strange problem I discovered (not fixed yet).
Script no longer requires GNU sed but works with other sed
implementations as well (only other one tested is macOS however).
Uses getopts to parse options. Usage is now:
usage: sgit [-h] [-V] [-v level] [-e command] <glob...>
-h print help and exit
-V print version and exit
-v level set verbosity level
-e command append sed command to execute on globs
which means that yes one can specify more than one glob. As long as one
sed command is specified (chose -e to match sed) and one arg is
specified after the last option then the command line is okay (whether
the sed command or file is okay is another matter entirely).
Verbose output to help test / debug features or if just interested in
what's being done.
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.
In `2011/borsanyi/README.md` there was a German UTF-8
character that was replaced by ASCII "ss".
This character prevented Jekyll::Converters::Markdown as in:
```
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '2011/borsanyi/README.md':
1054
The source text contains invalid characters for the used encoding UTF-8
1055
/usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:93:in `adapt_source': The source text contains invalid characters for the used encoding UTF-8 (RuntimeError)
...
```
The file `2001/ollinger/README.md` contained a single lower case
small letter e with a acute mark as defined by the UTF-8 character
for the 2 bytes: 0xc3 0xa9.
Replaced the RAW UTF-8 character: "LATIN SMALL LETTER E WITH ACUTE"
with the HTML "é". Not sure what the best way to handle this,
however.
This character crashed markdown tools such as _qlmarkdown_
AND it prevented GitHub from rendering the web site. GitHub
reported in "Build with Jekyll":
```
Conversion error: Jekyll::Converters::Markdown encountered an error while converting '2001/ollinger/README.md':
847
The source text contains invalid characters for the used encoding UTF-8
848
/usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:93:in `adapt_source': The source text contains invalid characters for the used encoding UTF-8 (RuntimeError)
849
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/kramdown.rb:90:in `parse'
850
from /usr/local/bundle/gems/kramdown-parser-gfm-1.1.0/lib/kramdown/parser/gfm.rb:56:in `parse'
851
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/parser/base.rb:69:in `parse'
852
from /usr/local/bundle/gems/kramdown-2.3.2/lib/kramdown/document.rb:102:in `initialize'
853
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown/kramdown_parser.rb:42:in `new'
854
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown/kramdown_parser.rb:42:in `convert'
855
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/converters/markdown.rb:77:in `convert'
856
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:101:in `block in convert'
857
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `each'
858
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `reduce'
859
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:99:in `convert'
860
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:83:in `render_document'
861
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/renderer.rb:62:in `run'
862
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:479:in `render_regenerated'
863
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:472:in `block in render_pages'
864
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in `each'
865
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:471:in `render_pages'
866
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:192:in `render'
867
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/site.rb:71:in `process'
868
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/command.rb:28:in `process_site'
869
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:65:in `build'
870
from /usr/local/bundle/gems/jekyll-3.9.3/lib/jekyll/commands/build.rb:36:in `process'
871
from /usr/local/bundle/gems/github-pages-228/bin/github-pages:70:in `block (3 levels) in <top (required)>'
872
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
873
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
874
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
875
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
876
from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
877
from /usr/local/bundle/gems/github-pages-228/bin/github-pages:6:in `<top (required)>'
878
from /usr/local/bundle/bin/github-pages:23:in `load'
879
from /usr/local/bundle/bin/github-pages:23:in `<main>'
```
Added `bin/sgit`.
This directory is NOT intended to become a huge software project
right now. For now it is just a convenient place to store tools.
Please avoid overthinking, over documenting tools under bin.
Later on there will be a tool that builds links in the web site
from JSON files, perhaps forms HTML files from markdown files, etc.
However we will have to make major progress on issue #1, issue #2,
issue #3 and issue #4 before such code can be written.
In some cases tools put under bin might go away later on
if they are no longer needed.
Probably one of the most requested mods was to merge years-spoiler.html
with years.html as how an entry does what it does, not what it does
at a high level is what is important.
This mod also allows us to maintain only one file for entry info.
The archive/archive-YYYY.tar.bz2 compressed tarballs
came from the old IOCCC web site files of the form
YYYY/YYYY.tar.bz2.
The directories archive/YYYY/ are added to .gitignore
so that one may unpack all of the archives without
adding content to this repo.
TODO: Mention the archive/archive-YYYY.tar.bz2 compressed tarballs
on the web site. Perhaps a archive/README.md file would be best.