Commit Graph
230 Commits
Author SHA1 Message Date
Landon Curt Noll d414b6d71f add quick-readme2index.sh, improve all-run.sh and readme2index.sh
Improved `all-run.sh` and `readme2index.sh` so that
certain command line options (e.g., -p, -P, -u, -U ...)
are only passed along to other tools if they are
given on the command line.

all-run.sh VERSION changed from "1.1.1 2024-01-19"
to "1.1.2 2024-01-20",

readme2index.sh VERSION changed from "1.1 2024-01-16"
to "1.1.1 2024-01-20".

Added `quick-readme2index.sh` that only calls
`readme2index.sh` if the `index.html` is not
a non-empty file, or of either `.winner.json`
and/or `README.md` is newer than `index.html`.

Updated all `index.html` files because the
the file contains a comment that includes
the newly modified readme2index.sh VERSION.
2024-01-21 00:21:40 -08:00
Landon Curt Noll c1466f5165 build index.html for all winners
Updated manifest as per recent file changes.

Updated winner `.winner.json` to reflect the manifest changes.

Added [bin/all_run.sh](bin/all_run.sh) tool to run a command over
all winning entries.

These tools had slight improvements in the help usage message:

* bin/gen-author.sh VERSION="1.3.1 2024-01-16"
* bin/gen-inventory.sh VERSION="1.0.1 2024-01-16"
* bin/pandoc_wrapper.sh VERSION="1.3.1 2024-01-16"
* bin/subst.default.sh VERSION="1.1.1 2024-01-16"
* bin/subst.winner-index.sh VERSION="1.1.1 2024-01-16"

The `bin/readme2index.sh` tool was improved so that
if the `index.html` file exists and the tool forms
the exact same content, then the file `index.html`
file is NOT touched.

* bin/readme2index.sh VERSION="1.1 2024-01-16"

We used the following command to generate `index.html` files
for all winning entries:

```sh
bin/all_run.sh -v 3 bin/readme2index.sh
```

NOTE: We have not (yet) built HTML files above the winner directory
level (e.g., no year level nor top level HTML), nor have be built
non-index HTML files for winners.

NOTE: By default we are running `pandoc(1)` with:

```
--fail-if-warnings=true
```

This means that any problems with markdown to HTML
generates an error.  This is done to be sure that
the HTML conversion is clean.

We had to fix the following `README.md` files:

* `2000/rince/README.md`

The reference [^2] was never used.  We made a guess that [^2] applies
to the same spot as [^1].  Perhaps there is a better spot where
[^2] applies?

NOTE: For every reference, there MUST be some place where that
reference is used.

* 2012/vik/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

* 2018/burton1/README.md

The reference [2] was duplicated.  We changed the
second [2] to [3].

NOTE: Every reference needs to have a unique number.

* 2020/carlini/README.md

The string "$...$" is assumed to be a TeX encoded string.

NOTE: Every "$..$" needs to be backslashed as in "\$..\$".

We also found 2 errors in the `author/author_handle.json` file set:

* author/Anonymous_2001.json

The `author/Anonymous_2001.json` file was missing.

* author/Jari_Arkko.json

The winner ID for `1989_jar.1` had a typo.
2024-01-17 00:32:39 -08:00
Cody Boone Ferguson ba0f1ea721 Fix heading level of 'Try' section
It was agreed to be '## Try:' but there were many files where it was
'### Try:'. This has been corrected.
2024-01-15 04:29:39 -08:00
Landon Curt Noll c6e6201209 release readme2index.sh version 1.0 2024-01-14
The initial release of `bin/readme2index.sh` tool that converts
`READMD.md` and various JSON files such as `.winner.json`
as well as "author/author_handle.json" files.

Applied the `readme2index.sh` tool to generate `2020/ferguson1/index.html`.

We generated the  `2020/ferguson1/index.html` by executing:

```sh
./bin/readme2index.sh -v 3 2020/ferguson1
```

NOTE: This above tool requires **pandoc to be installed**.
See the [pandoc web site](https://pandoc.org) for how
to install.  We used _HomeBrew_ to install it,
but there is also a _macports_ process as well.

NOTE: While the above web page does have formatting issues, it is
a first attempt data driven programmatic web page generation.

Some adjustments can be made by mostly improving `ioccc.css`,
and some perhaps by modifying how `bin/pandoc_wrapper.sh`
invokes pandoc.  But probably most of the improvements can
be made by fixing and improving `ioccc.css`.

TODO: Fix and improve the `2020/ferguson1/index.html`
web page by fixing and improving `ioccc.css`.

Moved scripts and tools needed to generate HTML pages
into a new `/bin` subdirectory.

TODO: Consider getting rid of the [build-ioccc
repo](https://github.com/ioccc-src/build-ioccc) and just use the
`/bin` subdirectory.

NOTE: Some links in the `2020/ferguson1/index.html`
web page do not (yet) exist.

TODO: Once the basic format of the `2020/ferguson1/index.html` web
page is somewhat reasonable, generate `index.html` pages for other
winners.  Generate the year level `index.html' files.
Generate the top level HTML files, including the missing
`location.html` file.

Greatly simplified the `.winner.json` file format,
removing a number of fields that were not strictly needed
for generating an inventory on a `index.html` page.

Updated various versions:

* `bin/gen-author.sh` VERSION="1.3 2024-01-14"
* `bin/gen-inventory.sh` VERSION="1.0 2024-01-14"
* `bin/manifest.winner.json.awk` VERSION="1.0 2024-01-14"
* `bin/pandoc_wrapper.sh` VERSION="1.3 2024-01-14"
* `bin/readme2index.sh` VERSION="1.0 2024-01-14"
* `bin/subst.default.sh` VERSION="1.1 2024-01-14"
* `bin/subst.winner-index.sh` VERSION="1.1 2024-01-14"
* `tmp/gen_path_list.found.sh` VERSION="1.1 2024-01-14"
* `tmp/gen_winner_json.sh` VERSION="1.1 2024-01-14"

The `.winner.json` file format from winner_JSON_format_version
"0.5 2023-11-04" to "1.0 2024-01-14".

All `.winner.json` files have been updated to use the
new `.winner.json` file format.

The manifest (`tmp/manifest.numbers` and `tmp/manifest.csv`) has
updated to use the new `.winner.json` file format.

The following procedure was used to generate the
`tmp/manifest.csv` manifest file:

0. open [manifest.numbers](manifest.numbers) in numbers: modify if/as needed

NOTE: Please try to keep the [manifest.numbers](manifest.numbers) spreadsheet
      in order order.  Use Organize -> Sort -> ((Sort Now)) to sort.

NOTE: Empty fields in the [manifest.numbers](manifest.numbers) spreadsheet
      are not allowed.  By default, a cell that is empty is colored
      as a warning.

1. File -> Export To -> CSV...
    * 1a. `[ ]` Include table names (unset)
    * 1b. Text Encoding: Unicode (UTF-8)
    * 1c. Click ((Save..))

2. Save As: manifest.csv
    * 2a. Select the `tmp` directory

3. Click ((Export))
    * 3a. If needed click ((Replace))

4. Execute ./tmp/[fix_csv.sh](fix_csv.sh)

NOTE: You must run the [fix_csv.sh](fix_csv.sh) in the above
      step in order to make the CSV file usable by other tools.

NOTE: If no changes are needed in the above step, the
      original file content will be restored.

5. Execute ./tmp/[gen_path_list.found.sh](gen_path_list.found.sh)

NOTE: The above step silently performs a `make clobber` at the
      top level, and so it takes a bit of time.

NOTE: If no changes are needed in the above step, the
      original file content will be restored.

6. Execute ./tmp/[check_path_list.sh](check_path_list.sh)

NOTE: The above step prints nothing and for an exit 0, then
      all is well.  If there is a problem, such as files
      found that are not part of the manifest, or files
      in the manifest that are not found, then an error
      message will be printed and the tool will exit non-zero.
      If errors are reported, go back to step 0 and
      correct the errors.

7. Execute ./tmp/[run_all.sh](run_all.sh) ./gen_winner_json.sh

NOTE: The above step will take a few seconds to run.  It will rebuild
      all `.winner.json` files for all winners.

NOTE: If no changes are needed in the above step, the
      original file content will be restored.

8. Execute `git status` and inspect changes

NOTE: Check in changes if and as needed.

NOTE: In a number of shell scripts under `bin/*.sh`,
      and in the `bin/manifest.winner.json.awk` script
      you will find comments of the form:

```
```

This is a note that when tools such as `jnamval` (and `jval` and `jfmt`) are
ready, these gross hacks should be replaced with calls to those tools.
Until they are ready, some must be careful with the layout of JSON files.

A number of bugs and typos have been fixed.

NOTE: Fixing typos in the files touched by this comment is welcome.
      This includes scripts, data files, text files, etc.

The _inventory_order_, _display_as_, _display_via_github_.  and
_winners_text_ fields of the [manifest.numbers](manifest.numbers)
spreadsheet were just set to have some initial values.
As they impact the inventory displayed on `index.html` pages,
their content needs to be improved.

NOTE: Improving the above mentioned fields of the
      [manifest.numbers](manifest.numbers) spreadsheet is welcome.
2024-01-14 22:03:28 -08:00
Landon Curt Noll f5a259d3b3 update .winner.json files as per recent file changes 2024-01-14 12:16:58 -08:00
Cody Boone Ferguson 094a4da91a Add 1992/adrian/try.sh
This script shows the entry itself as well as some of the other tools
that the entry generates. The adwc / wc one uses a pipeline to show the
output (with leading spaces and filename removed along with squeezing
spaces) and also writes each to a text file to use diff on, to show how
they have the same output.

Not all the tools are in the script. The adbasename might have a bug
(in any case it doesn't appear to function exactly like basename(1) in
that it requires two args, not one) so it is not used and adgrep is not
used either. For the latter one the author's remarks might provide some
clues as to why I did not include it.
2024-01-14 09:46:54 -08:00
Cody Boone Ferguson 85a9066b02 Add try scripts to 1992/albert 2024-01-14 09:13:46 -08:00
Cody Boone Ferguson b0918543df Add 1992/ant/try.sh
If you like ants there are now 1992 of them here to try out (whatever
that means :-) ).

Some typos in the test Makefile were also fixed (just those that I saw
as the command was scrolling by - I didn't look at the whole file).
2024-01-14 09:03:58 -08:00
Cody Boone Ferguson cda49daa4e Fix 1992/buzzard.2 alt code, add try scripts
The bug fix is simply so it can compile. It assumed exit(3) returned a
value, not void. The fixes noted in the remarks (though I did not see
them at a quick glance) of the author are not in the alt version (that's
the purpose of it).

The try.sh and try.alt.sh scripts correspond to the entry and the alt
code.

Updated .gitignore.

Added 'first.alt' to Makefile for the try.alt.sh script.
2024-01-14 07:28:59 -08:00
Cody Boone Ferguson 543b250815 Slightly improve 1992/buzzard.1/try.sh 2024-01-13 10:54:25 -08:00
Cody Boone Ferguson b639167e03 Added 1992/imc/try.sh 2024-01-13 10:48:32 -08:00
Cody Boone Ferguson 3f4d556101 Minor formatting update in 1992/marangon 2024-01-13 10:36:46 -08:00
Cody Boone Ferguson f9d5a7b907 Minor formatting fix in 1992/kivinen/README.md 2024-01-13 10:35:43 -08:00
Cody Boone Ferguson 7031130843 Rename 1992/runme.sh lush.sh and improve it
The script now lets one specify which compiler to use so that one can
(in the case that their cc is clang, for instance like it is with macOS)
specify a path to a real gcc compiler.
2024-01-13 10:29:59 -08:00
Cody Boone Ferguson 27ba4879a1 Improve 1992/nathan/try.sh 2024-01-13 10:22:32 -08:00
Landon Curt Noll 66a1c2efee Merge pull request #1845 from xexyl/birken2013-alt
Reword alt code suggestion in 2013/birken
2024-01-10 14:04:45 -08:00
Landon Curt Noll 259d8c8503 update manifest, remove inventory.html, update .winner.json
Update the manifest as per recent file changes.

Removed inventory.html from all winners as the inventory will be
added to the winner `index.html` instead,

Updated winner `.winner.json` files as per the above.
2024-01-10 14:03:53 -08:00
Cody Boone Ferguson 7825fc5e8c Reword alt code suggestion in 1992/kivinen 2024-01-10 09:12:04 -08:00
Cody Boone Ferguson 78883b5d15 Convert to/format markdown in 1992/buzzard.2
The file buzzard.2.README.md was formatted in markdown style.

The file buzzard.2.design was turned into a markdown file,
buzzard.2.design.md, and formatted in markdown style. This one was
problematic in some ways but I think it's sorted out now. In a few
places it was not entirely clear if certain things should be in code
blocks or not but they were made to be as they were on the same line as
code (after). It doesn't appear to be a comment in the syntax of
comments that later appears, however. Another one I was not sure about
is if the author meant '{ .. .. }' to be a way to say this is code
without the {}s or if that should be part of the code. As these are not
clear there might be some mistakes.
2024-01-03 06:46:36 -08:00
Cody Boone Ferguson ae0b11cdaf Add missing final comments to top README.md files
In some cases the comments were there but there was no section heading.
In others the section was not there at all.

These files have NOT been checked in other ways. That will come another
day most likely and very possibly not until early next year.
2023-12-30 07:17:33 -08:00
Landon Curt Noll 5859489b60 update .winner.json based on updated manifest.csv
We used:

```sh
cd tmp
./run_all.sh ./gen_winner_json.sh
```
2023-12-28 19:22:06 -08:00
Cody Boone Ferguson ba764a1833 Fix tmp/format-headers.sh, format headers
The script had "s surrounding the git ls-files command which turned it
to a single file which of course is wrong.

Ran script again fixing many README.md files that had incorrect number
of blank lines for critical headers.

This will have to be done a final but a good number of files have been
corrected.
2023-12-27 08:54:28 -08:00
Cody Boone Ferguson ceddedc171 Reword suggestion of alt code in 1992/kivinen 2023-12-27 08:21:34 -08:00
Landon Curt Noll c9a023ff09 note old Email, header formatting, improve copyright and license
For the top level and year level README.md, where email are found,
a note was added to the effect that email addresses found above are
for historical purposes only, and should not be used today.

Old references to asking for fixes, comments, when content was used,
and next contest links were replaced with a general reference to the FAQ.

Harmonized the Copyright and License and copyright dates.
Now using Creative Commons "CC BY-SA 4.0 DEED Attribution-ShareAlike 4.0
International".

The above Creative Commons will become the standard for the IOCCC.
Replaced old `png/by-sa-3.0-88x31.png` with a new ` png/by-sa.88x31.png` icon.
Updated the top level HTML files to use the license.
2023-12-26 14:43:30 -08:00
Cody Boone Ferguson 801f3fe90c Add missing comment in all Makefiles
The comment for the rule diff_alt_orig was missing. It was added like:

    sgit -e '/diff_alt_orig:/i \
    # diff alt and orig' '*Makefile'
2023-12-26 09:00:03 -08:00
Cody Boone Ferguson e0456a394b Improve 1992/gson/try.sh
Don't exit if it can't find a 'normal' dictionary file, skipping the
creation of one from mkdict.sh. Just use the one generated from
mkdict.sh if no other file can be opened (which most likely won't happen
but it can happen as not all systems have /usr/share/dict/words and the
others are unlikely in modern systems).
2023-12-19 09:41:08 -08:00
Cody Boone Ferguson 54c5271117 Add 1992/gson/try.sh, add note about optimiser
The optimiser must be disabled due to it otherwise crashing in macOS in
some invocations. This has been added to the Makefile, the use of -O0 is
forced and a note has been added to the README.md file.

The bugs.md file has been updated on details of how it uses gets() and
that text has been removed from the thanks file.

Minor format fixes in README.md.

The script added makes use of the author's script (that I added as
mkdict.sh for easier use) after first trying to find a dictionary file.
But one can override the dictionary file with the DICT environmental
variable.

This entry should now truly be done.
2023-12-19 09:07:37 -08:00
Cody Boone Ferguson 43774f02c0 Add missing alt subsections to 1992/buzzard.2 2023-12-17 12:15:01 -08:00
Cody Boone Ferguson b85e20aac3 Make alt code variables in Makefiles consistent
That is the comments have a general form and if they're for the alt code
they're defined in the alt code section. If they're for the entry and
the alt code they're above the CDEFINE variable.

The thanks file has been updated where it was needed.

Now only entries that have not been done need this improvement.
2023-12-08 04:48:23 -08:00
Landon Curt Noll 658669a73a improve .gitignore files, fix index.html links, sync CNAME
fix experimental web site links in experimental index.html

sync CNAME with https://github.com/ioccc-src/winner/blob/master/CNAME

improve .gitignore files

Added to each .gitignore file, comments on how to sort.

Put into winner .gitignore files, ignore *.dSYM files.

Put into winner .gitignore files, ignore indent.c,
indent.o and indent files.  This is done so that the
winner directory can more self contained.

We did not put into winner .gitignore files, however,
excludes of .-files as found in the top level .gitignore file.
As .-files are not allowed by mkiocccentry, the top level
.gitignore file remains sufficient.

Added to year level .gitignore files, excludes of
mkentry or iocccsize files as needed.

Sorted (via sort -d -u) all .gitignore file.
2023-12-08 04:06:44 -08:00
Landon Curt Noll 6206201d8a add make genpath rules, .path files, updated .top and .year
Add .path files to each winner directory: a file containing
the path to the winner directory from the top directory.

Changed YYYY/.year files to contain the paths, from the top
directory, if the winning directories for the given year.

Changed `/.top` to contain the IOCCC years.

Added `make genpath` rule to the top Makefile and the
year Makefiles to generate the above.

Added FAQ 6.8 to `faq.md` to explain the above.

Updated manifest to reflect recent changes to the list of files.
2023-12-08 01:29:43 -08:00
Landon Curt Noll 2f002af1c8 move archive files under archive/historic
Adjusted links and references to old archive files
to use the `archive/historic/` tree.

TODO: Build compressed tarballs for winning entries,
individual years, and the entire winning set under `archive/ioccc/`.
2023-12-07 19:17:46 -08:00
Cody Boone Ferguson 37a466224b Improve how redefine sleep in 1992/kivinen
Using a Makefile variable one can do for instance

    make clobber SLEEP=30000 alt

to change the Z macro, the time to sleep.
2023-12-07 05:40:15 -08:00
Landon Curt Noll f929afd344 update .winner.json
We used:

```sh
./run_all.sh ./gen_winner_json.sh
```

to update `.winner.json` files due to recent changes
made to `manifest.csv`.
2023-12-05 22:51:27 -08:00
Landon Curt Noll 1e1f962c30 add to make clobber, removal of *.dSYM 2023-12-05 02:22:49 -08:00
Cody Boone Ferguson 1f3d4babb8 Make 1992/marangon main() return int, not void
Due to the fact that void main() will not work in some systems, of
course.
2023-11-25 06:48:51 -08:00
Cody Boone Ferguson 0be0511329 Make 1992/kivinen main() have 2 args, not 1
Due to a clang defect.
2023-11-25 06:46:33 -08:00
Cody Boone Ferguson 30c59761df Mass fix Makefiles: $(MAKE) -> ${MAKE} 2023-11-19 06:31:28 -08:00
Cody Boone Ferguson fa80f73859 Fix infinite loop in 1992/vern
If one entered input < 0 || > 077 (octal) the program would enter an
infinite loop that flooded the screen, forcing the user to terminate the
program.

The problem was that scanf(3) (with "%o %o" specifier string) was in a
loop checking for return value of 2 (this was not a problem because
scanf(3) does not return until all the specifiers are processed or I
suppose some error occurs) and not checking the values. Instead it just
checked a function on the numbers. This fix involves using scanf(3) with
the specifier "%4s %4s" and then using strtol(3) with base 8 and then
checking for < 0 || > 077 (using "%o %o" will not work).

The game now functions as expected without flooding the terminal if
invalid input is given. The judges' remarks about the range has been
kept in as it's still invalid it just won't flood the screen.
2023-11-19 04:36:49 -08:00
Cody Boone Ferguson bc35c37748 Improve how gcc/clang is detected in Makefiles
Rather than check if $(CC) IS gcc or IS clang check for $(CC) containing
gcc or clang. This is because in some systems or conditions the compiler
might not be called JUST gcc or JUST clang. For instance gcc in MacPorts
is called gcc-mp-13 (for example) but without this change one would have
to symlink gcc to gcc-mp-13 or copy it to gcc.

The FAQ has been updated to address this.
2023-11-18 06:10:02 -08:00
Cody Boone Ferguson 76efe07785 Make 1992/westley whereami code scripts
It is not actually necessary to have a program that uses curses to get
the number of columns. One can use tput cols or stty size to get that.
Thus there is no need to have a C program that links in the curses
library.
2023-11-16 04:12:41 -08:00
Cody Boone Ferguson c4a79981af Improve 1992/westley/try.sh + whereami code
The try.sh now allows for specifying CC=foo.

The whereami.c and whereami.alt.c also allows for this. It leaks memory
but the OS should reclaim it and it's not a lot. It leaks memory because
if calloc(3) returns NULL it sets the string to a literal string to
prevent any problems with it (though one might wonder if the rest of it
will work).
2023-11-14 03:30:36 -08:00
Cody Boone Ferguson 0d90372331 Improve 1992/nathan/try.sh
Allow one to specify CC=foo, defaulting to cc.
2023-11-14 02:48:47 -08:00
Cody Boone Ferguson 649239f3fa Improve 1992/buzzard.1/try.sh
Now allows one to pass in CC=foo, defaulting to cc.

Added -Wno-implicit-int to CSILENCE.
2023-11-14 02:46:56 -08:00
Cody Boone Ferguson ac1334c84d Make 1992/kivinen/kivinen.c alt code
Originally the main version was changed to have a call to usleep(3) as
the game moves so fast. It was discussed a while back however to in
cases like this to make it so that the build/use/try sections refer to
the alt code and then instead of an alternate code section have an
original code section. Because of this the modified code was changed to
be an alt version and then restore the original with the fixed code.

As for the fixed code (and also alt code) I have made it look more like
the original by changing the 'ext' macro to be 'exit' (with the comma
operator). I tried and believe I succeeded (mostly if not totally) in
making the lines start and end on the same columns and in at least some
lines the same character starts and ends the lines as the original.
2023-11-12 03:19:47 -08:00
Cody Boone Ferguson 1364ac3e87 Format/typo check + update bugs.md for 1992/vern
The bugs.md has both a feature and a bug or maybe mis-feature that might
be good to fix. I gave a tip in the bugs.md that might help with parsing
the code a bit.

The README.md file has been typo and format checked/fixed.

This should complete 1992.
2023-11-09 08:18:09 -08:00
Cody Boone Ferguson 8d5a01d512 Add 1992/nathan/try.sh + format fixes
The try.sh script runs the commands provided by the judges in the try
section (which has been updated to just refer to './try.sh') and one I
included as well.

The README.md file has been format/typo checked.
2023-11-09 07:43:36 -08:00
Cody Boone Ferguson 200b1223d0 Make 1992/imc more like original + formatting
The original imc code assumed that exit(3) returns a value but it was
changed to use the comma operator:

    #define			  ext(a) (exit(a),0)

Instead of this, I redefined exit like I have done with other fixes, to
make it more like the original.

I also format/typo checked the README.md file.

I cannot test the raster files as I don't have access to a Sun box but
the text seems good. I tried some of the example commands given by the
author but I did not try all the options. What I tested looks good as
best I can tell.

For fun and because I have fond memories I added a link to dot matrix
printers where the author noted that they are useful, though I guess
most people don't have access to them nowadays (and many don't even know
what they are which is another reason for a link :-) ).

This should complete 1992/imc.
2023-11-09 05:55:39 -08:00
Cody Boone Ferguson 8efa010293 Format/typo check 1992/kivinen/README.md 2023-11-08 12:10:54 -08:00
Cody Boone Ferguson 8c32e1db37 Format/typo check 1992/marangon/README.md 2023-11-08 12:06:47 -08:00