302 Commits
Author SHA1 Message Date
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
Cody Boone Ferguson 881aac6767 Add missing space after = in 1985/shapiro
.. the Makefile, that is.
2023-12-07 05:41:58 -08:00
Cody Boone Ferguson 8f4f9a650a Improve how to redefine size in 1985/shapiro
Now one can just do:

    make clobber SIZE=5 alt

for example. This is done through a Makefile variable.
2023-12-07 05:26:52 -08:00
Cody Boone Ferguson e8ad7a89f5 Add comment about SLEEP var in lycklama Makefile 2023-12-07 05:21:23 -08:00
Cody Boone Ferguson feedf2133f Improve how to define sleep time in 1985/lycklama
With Makefile variables one can just do for instance:

    make SLEEP=700 clobber alt

which will set the macro Z to 700.
2023-12-07 05:17:09 -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 8fc785aa24 Second alt version added to 1985/sicherman
Since some versions of clang object to the number of args to main()
(requiring, supposedly, 0, 2 or 3[0] args) and in the case that it is
enforced to not allow 1 I have added a second alt code that will be
compiled IF sicherman.c fails to compile (and it'll compile into
sicherman, not sicherman.alt2 or something like that). This required
another change which also is in sicherman.c.

The macros in the code that were C (which only translated to '/**/') and
V were changed to lower case letters. Then the 'c' in 'subr()' was
changed back to upper case. This also feels better since the 'C' (now
'c') in main() is although used it is not necessary either since it just
is an empty comment. The primary reason for this change is that in the
new version we obviously want the first arg of main() to be 'C' but with
the macro 'C' this would not be possible. The change to 'v' from 'V' is
simply to match case as both were in the original main() args (as ints).

I am not sure I like having to change the macro names to lower case but
at the same time the 'C="..."' in 'subr()' makes more sense to be upper
case as it's about the language and it also allows in the new version
that main() can have upper case C. Of course I could have made that
change in just the new version but it felt better to match style as much
as possible.

[0] The version that objects to this still seems to allow 1 arg even
though it claims that it requires 0, 2 or 3 args.
2023-11-25 05:44:42 -08:00
Cody Boone Ferguson dadcaf92c4 Add second arg to main() in 1985/august
Due to clang defect in number of args allowed in main(). Some versions
will if you use, say, 4 args, object and report that main() can only
have 0, 2 or 3 args. That same version does not appear to object to 1
arg (bug?) but it's entirely possible that this changes so I have
changed the number of args of main() to 2 even though it's unused just
out of abundance of caution.

Updated CSILENCE for no implicit int. I have to test the unused
parameter warning. That might need to be added to,
-Wno-unused-parameter, but I have to find out which compilers will or
will not object to it and that can come later on.
2023-11-25 04:23:47 -08:00
Cody Boone Ferguson 44f311c91c Slight clarification in 1985/lycklama
I believe that entries that alt versions are recommended to try first
should say what it looks like in modern systems so much as what it
looked like with systems of the time it was published.

Other entries with this have to be located as well so I've put it in the
todo.md file too.
2023-11-22 05:04:14 -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 824ad34200 Make 1985/sicherman close to original as possible
... I think :-)

The thanks file gives much more details on how this works and as I am
very tired and want to get this in so I can do other things I will not
duplicate it here. It might become clear in that file why I believe it
cannot be made any more like the original without breaking it though I
left some questions for the reader to answer for themselves.

The Makefile also had a fix: the 'alt' rule was in error so that running
'make alt' in the directory would compile it to 'alt', not
'sicherman.alt'.
2023-11-18 04:20:24 -08:00
Cody Boone Ferguson 7c9173ef27 Further improve fix to 1985/sicherman
The subr() function can now be called.
2023-11-17 09:53:07 -08:00
Cody Boone Ferguson 142a2f2863 Make 1985/sicherman even more like original
There were some places that macros could be used and some commented code
could be removed to make it more like the original too.
2023-11-17 05:23:54 -08:00
Cody Boone Ferguson e8eec65f9b Make my fix to 1985/sicherman more like original
Yet again I was able to make it more like the original. This was done by
changing the 'C' macro to be 'c' and 'V' macro to 'v' so that I could
use 'C' and 'V' in main(). A minor downside is that the ')' at the end
of the line

     *	up.) (In the C Manual)*/

had to be commented out but since main() can now have both 'C' and 'V'
as parameters of the same type this seems well worth it.

Notice how the 'c' macro is now what the 'C' originally was, /b/! The
'V' to 'v' macro did not change its definition but now 'V' can be used.

Also the variable _ can be assigned to in main() it's just that the
subr() function cannot be called (previously both parts were commented
out).

Since C is now free we can have in subr() C be a char * which is what it
was originally.

Finally instead of having pairs of '"'s in subr() for the string
(assigned to C) we just escape the inner quotes.

The only difference from the original, besides the macro names and the
look it up in the C Manual part (I think in my tired head), is that some
of the macros have to be expanded and the subr() cannot be called. If I
can later on (that I am working on this is circumstantial, seeing an
untracked file when trying to clean up git status as it's too messy now)
figure out how to not have to expand the macros that would be great but
it's very possible that this is as close to the original as possible.
But since I said that before who knows.
2023-11-17 03:39:24 -08:00
Cody Boone Ferguson b3b4027b73 Add alt code to 1985/shapiro
This alt code allows one to resize the maze. Obviously if one uses -D
with a value that's not a number it will fail to compile. If it's <= 0
|| >= 5000 it will set to the default of 39.

The try.alt.sh script plays with this, first selecting a random number
(in range $RANDOM % 38) to compile with and then run. After that it runs
in an infinite loop, exiting only if input includes non-digit
characters. A value >= 5000 sets it to the default of 39 (in the code).
2023-11-15 14:57:06 -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
Landon Curt Noll 3fc44672b8 fix a few more quasi-common headers in winner README.md files 2023-11-02 16:10:34 -07:00
Landon Curt Noll fbdd8e826b fix spacing in header for 1985/lycklama/README.md 2023-11-02 16:05:01 -07:00
Landon Curt Noll d2188d1491 fix a few more standard header lines in winner README.md files 2023-11-02 16:01:23 -07:00
Landon Curt Noll fbd20cfdc2 fix standard headers and header spacing in winner README.md files 2023-11-02 15:45:36 -07:00
Cody Boone Ferguson 5041a0d592 Typo fix in all entry Makefiles
Change the comment

    # Special flags for this entry

to

    # Special Makefile variables for this entry

because these are actually variables and not flags.
2023-11-01 03:36:29 -07:00
Landon Curt Noll 7cb3c44a3b removed .id files from winning dirs
The `.id` files are no longer needed and so they were removed.

The `winner_id` (the contents of the `.id` files) are simply
a concatenation of "year" and "_" and "dir".

Adjusted `.inventory.html`, `tmp/README.md`,
`tmp/fake.gen_inventory.sh`, and the manifest according
to the above.
2023-11-01 01:19:36 -07:00
Landon Curt Noll a17fe36163 add tmp/fake.gen_inventory.sh tool
The new tool, tmp/fake.gen_inventory.sh, now adds
a fake .inventory.html file to each winner entry.

Once the winner2nventory tool is written, the .inventory.html
will contain links to all winner files listed in the inventory.
For now, the tmp/fake.gen_inventory.sh tool just creates
a placeholder file.
2023-11-01 00:47:43 -07:00
Landon Curt Noll 2e5f868896 improve Nu Html Checker code in index.html 2023-11-01 00:17:07 -07:00
Landon Curt Noll 1883e441c7 remove use of FONT from stb index.html files
We are still seeing if we can get the validator to work.
2023-10-31 22:44:17 -07:00
Landon Curt Noll d6f3d20bac improve winner index.html for a validator attempt 2023-10-31 22:40:25 -07:00
Landon Curt Noll a42aeeca8f add stub index files for each winner 2023-10-31 22:26:09 -07:00
Cody Boone Ferguson b022c51f1e Make 1985/sicherman even more like original
I noticed by chance that some '*'s could be changed back to 'b' so this
was done in the places it should have been kept.
2023-10-27 06:34:16 -07:00
Cody Boone Ferguson a1482ac073 Minor fixes in 1985/sicherman update
The word 'manual' should have been Manual and this has been restored.

I added to the thanks file more details on how it was fixed to not
require -traditional-cpp.
2023-10-27 06:28:15 -07:00
Cody Boone Ferguson 8d4ce3b843 Make 1985/sicherman even more like original
By changing some macros to what they used to expand to more of the code
can be used / not commented out. For instance now subr() no longer is
commented out. It cannot be used but it now is uncommented to make it
more like the original, even using the C macro as the arg (albeit
without a type specified as it actually just translates to /**/). The
macro that C used to use, 'b' (which is '*'), is still used just not in
C as doing so will cause compilation problems.

The single arg of main() was commented out because some versions of
clang do not only allow one arg to main().

There might have been other things to make it more like the original as
well.
2023-10-27 05:57:55 -07:00
Cody Boone Ferguson f5f8ddd92e Add note about alt code of 1985/sicherman 2023-10-27 04:06:50 -07:00
Cody Boone Ferguson 38bda8eb96 Minor alternate code fixes in 1985/lycklama 2023-10-27 04:04:37 -07:00
Cody Boone Ferguson e601a8f595 Change '#### Try' to '### Alternate try'
This does not complete the alt code related headers but I noticed this
and it was easy to do quickly. Unless I run across another when I am
working on the README.md files of the entries I will probably have to do
the rest manually as I come across them as most likely the headers are
missing.

This was done as

    sgit -e 's/^#### Try/### Alternate try/g' '*README.md'
2023-10-26 08:57:32 -07:00
Cody Boone Ferguson ff72c76ff1 Change alt/orig to build/to use heading levels
As the 'Alternate code' and 'Original code' heading level is now 2 the
'To build' and 'To use' subsections should be level 3, not 4, and also
reworded, this was done:

    sgit -e 's/^#### To build/### Alternate build/g' -e 's/^#### To use/### Alternate use/g' '*README.md'

Many more have to be updated and this will be done manually at another
time.
2023-10-26 04:53:08 -07:00
Cody Boone Ferguson 90af5ac98c Change heading level of 'Original code'
In the case where we recommend trying the alternate code first, the
lower section is 'Original code' but this was at heading level 3 when
discussion suggests 2 so this was done as well:

    sgit -e 's/^### \(Original code\)/## \1/g' '*README.md'
2023-10-26 04:42:54 -07:00
Cody Boone Ferguson 684ed89d7e Changing heading level of 'Alternate code'
Change level 3 (###) to level 2 (##):

    sgit -e 's/^### \(Alternate code\)/## \1/g' '*README.md'

which is the same as:

    sgit -e 's/^### Alternate code/## Alternate code/g' '*README.md'

This is per discussion in GitHub.
2023-10-26 04:36:57 -07:00
Cody Boone Ferguson b77347cc35 Change 'To run' to 'To use' in all README.md files
As in:

    sgit -e 's/# To run/# To use/g' '*README.md'

This makes consistent the message for how to use the program. 'How to
use' was chosen because one can run a program just by doing './foo' but
that doesn't imply that's how to use it but the purpose of the section
is how to use it.
2023-10-26 04:05:50 -07:00
Landon Curt Noll 00c9d60266 improve diff files
We now have 6 diff rules:

    diff_orig_prog
    diff_prog_orig
    diff_alt_prog
    diff_prog_alt
    diff_orig_alt
    diff_alt_orig

The FAQ for these diffs needs to be updated
as we have 6 types of diffs now.
2023-10-23 10:18:20 -07:00
Landon Curt Noll 71f1463547 Rename diff Makefile commands
Renamed these Makefile rules:

    orig_prog_diff ==> diff_orig_prog
    alt_prog_diff ==> diff_alt_prog

Updated thanks-for-fixes.md and faq.md accordingly.
2023-10-22 17:26:22 -07:00
Cody Boone Ferguson 4ffebe9a1d Format fixes in 1985/sicherman/README.md 2023-10-22 08:58:57 -07:00
Cody Boone Ferguson a7e2f8001b Format fix in 1985/lycklama wrt original code 2023-10-22 08:55:16 -07:00
Landon Curt Noll 8471e805ed add orig_prog_diff and alt_prog_diff rules to Makefiles 2023-10-18 17:00:02 -07:00
Landon Curt Noll e1cd30eff0 change use of <br> with blackslash for markdown line breaks 2023-10-18 16:21:43 -07:00
Cody Boone Ferguson 2dd5bd4c2e Format/typo check 1985/sicherman/README.md
Unless (as seems possible) a format/style change is needed for alt code
sections, this should be the final pass over it.

The thanks-for-fixes.md file was fixed to not refer to the alt code for
the original but rather refer to sicherman.orig.c. The alt file was not
removed, however, because it is not yet clear how to deal with the
situation where alt code is the same as the original code and in
particular wrt Makefile rules. This is another reason that the README.md
file might need to be revisited again.
2023-10-16 13:29:21 -07:00
Cody Boone Ferguson 6b8c7deacb Typo/format fix 1985/shapiro/README.md
This should be the final pass of this file unless something else is
decided to suggest otherwise.
2023-10-16 13:18:14 -07:00
Cody Boone Ferguson 8406a7ec97 Swap alt/main in 1985/lycklama
This is a rare case where it's better to first try the alternate code as
it moves too quickly to see in modern systems. Thus the build/try
section refers to alt and it explains how to reconfigure the time for
usleep(3). The original version is described in the Original code
section. It is encouraged to try this after trying the alternate code.

I also updated the thanks file to note that part of the fix to this
entry was the inclusion of unistd.h.

With this commit the README.md has also had a final pass of format/typo
checks and fixes though it might be that the way the alt/original
build/try section is written might be standardised in which case this
file would have to be modified again.
2023-10-16 13:13:02 -07:00