387 Commits
Author SHA1 Message Date
Cody Boone Ferguson 34c8958ac2 Improve 2013/birken/try scripts 2024-01-26 11:15:14 -08:00
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 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 e6fad17fc3 Reword alt code suggestion in 2013/birken
This also completes an item in the todo file and that has now been
removed.
2024-01-10 10:02:30 -08:00
Cody Boone Ferguson e4b7cbf3a1 Fix 2013/cable3 for clang in linux 2024-01-08 08:14:46 -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
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 e4ca73288e Add missing alt subsections to 2013/cable3 2023-12-17 12:40:44 -08:00
Cody Boone Ferguson 26edb2a70a Improve how to redefine sleep in 2013/birken alt
Now one can just do

    make clobber SLEEP=500 alt

or whatever.
2023-12-12 05:17:43 -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 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 0eeb501060 Fix synopsis in 2013/dlowe/README.md file
Although it appears to accept non digits I did not have time to test it
more and I see now it has no real purpose, showing the same thing, so I
have removed that and noted that it expects numbers.
2023-12-04 11:56:27 -08:00
Cody Boone Ferguson dcc3fc8f59 Rename 2013/endoh4/run.sh to try.sh + formatting
I believe that this completes the review of 2013.
2023-12-04 08:33:39 -08:00
Cody Boone Ferguson f904825e14 Format/typo check + update bugs of 2013/endoh3 2023-12-04 08:28:13 -08:00
Cody Boone Ferguson 7dd7fd786d Format/typo check 2013/endoh2 2023-12-04 08:21:12 -08:00
Cody Boone Ferguson 594b9f32f3 Add 2013/endoh1/try.sh + format/typo checks + bugs
The bugs.md file has limitations of the entry added to it.

The README.md file was format/typo checked.

The try.sh script is as usual. I also added a command to try in the
'try' section that is not in the try.sh script due to it being long
output but still fun to try.
2023-12-04 08:15:22 -08:00
Cody Boone Ferguson c5b831f3a0 Format 2013/dlowe, new script, rename others etc.
The demo.sh was renamed try.sh to be like the other entries.

The new script diff.sh runs some commands that I had previously added
(to demonstrate the entry) but which would be better in a script.

Renamed sflen.sh (for sparkline file length) to be slflen.sh (for
sparkline file length also).

Updated bugs.md - added more features that the author noted.

Format/typo check README.md file.

This should complete the review of 2013/dlowe.
2023-12-04 07:48:23 -08:00
Cody Boone Ferguson a6a108c57b Remove 2013/cable3 from bugs.md
As the bug status was a missing file and it was actually hd.img and as
that was added to the repo the entry can be removed from the bugs.md
file.

I also added some important points for the entry about quitting
(elaborating) and also how to input certain keys like alt/ctrl
combinations (amongst others) that the author had later on in the
README.md file. The former might especially be important if someone did
it at the console and was not aware of how to open another console but
even so it can be annoying having to close a tab just to stop a program.

Now I can say that 2013/cable3 is almost certainly complete (review
wise?).
2023-12-04 05:34:06 -08:00
Cody Boone Ferguson e7c427d40c Add 2013/cable3/hd.img
It was suggested that the 40MB size is not too big for the repo so I
have added it. It was linked to by the author, from dropbox, at:
https://bitly.com/1bU8URK.
2023-12-04 05:24:12 -08:00
Cody Boone Ferguson 50d39a8984 Remove unused screenshot of tweet in 2013/cable1
This one was added a while back but by accident was never actually
embedded into the README.md.
2023-12-03 13:53:30 -08:00
Cody Boone Ferguson 4ff13212f4 Format/typo check 2013/cable3 2023-12-03 10:22:47 -08:00
Cody Boone Ferguson 45a7c8ca5f Add 2013/cable2/try.sh + update bugs + formatting
The try.sh script is as usual but it integrates some of the comments in
the previous set of commands in the 'try' section (in particular about
different typesets).

The bugs.md was updated with features, not bugs.

Typo/format check README.md file.
2023-12-03 09:50:59 -08:00
Cody Boone Ferguson 39cb779c19 Add 2013/cable1/try.sh + format/typo checks
Rather than link to twitter.com there is a new image of the tweet
(screenshot).

The try.sh has a joke Easter egg in it based on said tweet.

Format/typo check README.md file.
2023-12-03 09:28:16 -08:00
Cody Boone Ferguson a441c47ec0 Format/typo check 2013/hou 2023-12-03 09:10:37 -08:00
Cody Boone Ferguson 4217b3f065 Format/typo check 2013/morgan2 2023-12-03 08:31:45 -08:00
Cody Boone Ferguson 1f92e5153f Format/typo check 2013/morgan1
I also included the dates for the two unnamed undated comets that the
author referred to so that one can see what is meant: Comet Halley and
Comet Hale-Bopp, labelled Ha and Hb in the program which is now noted in
the README.md file too.
2023-12-03 07:55:18 -08:00
Cody Boone Ferguson a8b8cd2883 Improve 2013/misaka/try.sh
Use both long_cat and same_as_long_cat, redirecting to a text file each,
and then using diff -s on them to show they're the same.
2023-12-03 04:40:04 -08:00
Cody Boone Ferguson f7c5f0cbc2 Make 2013/mills fix formatting match original
Use -Dl=10 in Makefile so that the line ending is the same and the
number of characters is also the same. Also l looks like 1 so it's
better in that way too.
2023-12-03 02:18:52 -08:00
Cody Boone Ferguson 7301eeb3fa Add 2013/robison/try.sh
The README.md was already fine: just the update to try.sh instead of the
long commands to run was changed.
2023-12-02 14:54:21 -08:00
Cody Boone Ferguson fb65693ef5 Move 2013/birken/try.sh to try.alt.sh, add try.sh 2023-12-02 14:47:46 -08:00
Cody Boone Ferguson b157e5ddaf Fix 2013/mills + format/typo checks
The problem that was showing up is that one could connect and it would
show the time once but then it would close the connection and be unable
to connect again, showing an error in the browser. After looking at the
code it became clear it is because the backlog to listen(2) was 1 and
this is not enough for close(2) and then immediately listening again.

I updated the bugs.md file too - added a feature, not a bug. The author
notes that one cannot start the program right after termination and have
the program successfully bind the socket. They did note the fix and it's
well known (at least to those of us who are experienced in socket
programming :-) ) but as it was documented it is a feature not a bug. It
just means one has to wait for a few seconds (though 'few seconds' can
vary).

The README.md file has been format fixed.
2023-12-02 11:51:18 -08:00
Cody Boone Ferguson c109cd23cc Improve 2013/misaka/try.alt + Format/typo check 2023-12-02 11:28:06 -08:00
Cody Boone Ferguson 250a5a12be Update 2013/birken/try.sh + format/typo checks
The try.sh script now does a random run of the program (previously in
the remarks in the try section) involving perl but only if perl is
installed in the system.

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

It is not clear if this entry is done or not yet as it might be improved
if try.sh is renamed try.alt.sh (for the alt version which it uses) and
a new try.sh be formed which uses the original code so that one does not
have to do say:

    BIRKEN=birken ./try.sh

This probably would be better but it is not done yet.
2023-12-02 11:07:31 -08:00
Cody Boone Ferguson 30c59761df Mass fix Makefiles: $(MAKE) -> ${MAKE} 2023-11-19 06:31:28 -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 3d2fdd8cc6 Improve 2013/misaka/try.sh
Get CC, defaulting to cc.
2023-11-14 05:01:12 -08:00
Cody Boone Ferguson 77c63be39a Restore cursor visibility in 2013/birken at end
Make line ending of 2013/birken the same by redefining exit(3) to do the
'return system("reset");'.
2023-11-14 04:56:35 -08:00
Cody Boone Ferguson f954d8d4a5 Make 2013/birken restore sanity after exit
As long as the program (alt code and otherwise) runs to completion the
program will return instead of 0:

    system("reset");

so that the terminal becomes sane again (otherwise cursor is invisible).
One could also use 'tput cvvis' but this is longer and I wanted to make
the column as close to the original ending as possible.
2023-11-14 04:50:29 -08:00
Cody Boone Ferguson ef8c84a3b1 Improve 2013/birken/try.sh
Get CC, defaulting to cc.
2023-11-14 04:21:43 -08:00
Landon Curt Noll e00d20111d rename .inventory.html -> inventory.html
Due to GitHub not serving nor rendering HTML files whose filename
starts with "." (dot), we renamed `.inventory.html` to `inventory.html`.

Renamed: `tmp/gen_dot_winner.sh` -> `tmp/gen_winner_json.sh`
Fixed URL generation for GitHub links in `inventory.html`.

The manifest was updated accordingly.

The `tmp/README.md` file was updated accordingly.
2023-11-06 02:23:30 -08:00
Landon Curt Noll 4f88c4214b add initial .winner.json and .inventory.html for winners
Fixed an incorrect author win for "1989_jar.2" in `author_wins.numbers`
and `author_wins.csv`.

Changed winner_JSON_format_version to "0.5 2023-11-04".

Added `gen_dot_winner.sh` tool to generate .winner.json and .inventory.html
for a winner.  This tool uses [pandoc](https://pandoc.org) to convert
markdown to HTML.

Used this command to generate `.winner.json` and `.inventory.html` for
all winners:

```sh
./run_all.sh -v 1 -D 1 ./gen_dot_winner.sh
```

Updated `tmp/README.md` to reflect the above.

Retired "fake.gen_inventory.sh" to `tmp/OLD_manifest/fake.gen_inventory.sh`.

Added `-D level` flag to `run_all.sh` to specify the `-v level` for
the tool that is being run.
2023-11-06 00:22:19 -08:00
Cody Boone Ferguson 249e865de2 Mass edit README.md: remove top award/author lines
As requested on GitHub: a tool that will be written, readme2index, will,
as explained:

    '... will take the converted HTML from the README.md markdown and
    inject it into an HTML template. Things such title, award one and
    author information will be injected into the HTML page ahead of the
    HTML that was converted from the README.md markdown. Without going
    into details of HOW at this time, the result will be a coherent HTML
    index.html page with the winner title / award, winning author
    information, and important file links come from other sources and
    NOT from the README.md file.

    The text from the 1st award line, thru the authorship information,
    and up to but not including the "## To build:" line in the README.md
    file will just get in the way. Moreover authors might be tempted to
    try and maintain that top of README.md text instead of working with
    the author/_author_handle_.json and winner .winner.json files.

This was done with my[0] sgit(1) (https://github.com/xexyl/sgit) tool like:

    sgit -o -n -e '/^## To build:/,$p' '[12][0-9][0-9][0-9]/*/README.md'

[0] Is that shameless self-promotion? I don't know but I don't care: it
is generally a very useful tool and has been used in other repos too.
Besides, I've done it many times before and it's a great example that I
will be adding to the README.md file of the tool, one I hadn't thought
of doing.
2023-11-05 03:39:46 -08:00