Rather than having the string that is run via system(3) use
-Wno-return-type the generated code (also in the string) now returns 1;
rather than 'return;' so that main() has a proper return statement.
This means the string was updated and the call to system(3) was also
updated but it is a bit better now. It is hoped that this is the last
time (..yet again..) that this will have to be updated to work with
various systems but as before the magic is in the thanks file, at least
for now.
It came to my attention that some versions of clang trigger and
additional warning that has to be disabled in order to compile the a.c
that the entry generates. This has been fixed.
I am NOT including the translate.c file that I wrote to come up with the
proper string (it encrypts and decrypts though with some limitations) as
I don't want to give it away too much. I MIGHT include it on my website
another time in case it is ever necessary (though the hope and belief is
it won't be but who knows with clang). This would be AFTER the website
has been looked at. This has already taken too much time to fix. It is
now time to finish 1992 and then go on to 1993.
Since the author refers to the tool as 'sorta' it is now a symlink to
the program. Updated .gitignore.
The sorta.README.md file has been format fixed.
The README.md has been partially checked. The reason for this commit
when it's not is I need to find where a problem in formatting is and in
order to do that I need to see the rendered html (a code block is not
terminated it would appear).
The README.md file has been format and typo checked.
The Makefile was updated slightly to disable implicit int warning and
also to include certain header files for the syscalls used. This is not
strictly necessary but since some systems (like macOS) do have problems
with some functions not being declared this was done as it does not have
an adverse effect.
The alt code is based on the author's remarks where the computer will
always win (supposedly :-) :-) ). It involves the new script ttt.alt.sh
which is copied to ttt.alt with make. This script has changes from
ttt.sh so that it doesn't stomp over the files that ttt.sh makes.
The Makefile clobber rule had a typo fix as well which prevented a file
from being removed (a file specified twice instead).
The README.md file has been typo and format fixed.
The .gitignore file has been updated.
Remove the 2>/dev/null as that is no longer needed as the code was
updated a while ago to use fgets() in the enciphered string (the output
program used gets() but now it uses fgets()).
Format and typo fix README.md.
I believe this completes 1991/dds.
With more clever use of the Makefile the number of characters is back
down to 80 which is what the original was!
This also fixes the warning that was introduced when it was dropped back
down to 85. 'B' is defined as '(int)b' which is used in two places where
a cast is necessary or otherwise will silent a warning.
The README.md file has been checked and this should complete this entry
now.
Now allows for 'q' to exit the maze. This is to be a bit more intuitive
at least for those who use the alt version, which is not the recommended
version to try first nor should it be. This change is not in the
original nor should it be.
The alt code will make it a bit less unwieldy for vi(m) users by
changing the following input keys to be like in vi(m):
- Use 0 to go to first column.
- Use $ to go to last column.
- Hit ESC to go back to command mode (instead of form-feed, ctrl-L).
- Use w to go forwards one word.
- Use b to go backwards one word.
- Use q to exit.
The rest of the keys were left unchanged.
Format fix README.md file.
This completes 1991/ant checks unless I'm very much mistaken.
The alt version can be more at home for those familiar with vi(m) (it
certainly is for me): instead of 'f' for forwards, 'l' for left and 'r'
for right it is now 'k', 'h' and 'l' respectively. The program does not
allow one to go backwards so this was not touched but if it did it would
have been 'j': because we vi(m) users are strange :-)
There were two crashes that I noticed, both due to atoi(3) being called
on an arg without a type which ended up being an implicit int rather
than a 'char *'. This is for the x and y coordinates. I don't have an
example command line to test different configurations but now the
program shouldn't crash unless the file cannot be opened. See bugs.md
for details there (whether it should crash or not on not being able to
open the file is debatable I suppose but I left it in as a feature, not
a bug; the others made the program unusable which is why they were
fixed).
The alt version can be more at home for those familiar with vi(m) (it
certainly is for me): instead of 'f' for forwards, 'l' for left and 'r'
for right it is now 'k', 'h' and 'l' respectively. The program does not
allow one to go backwards so this was not touched but if it did it would
have been 'j': because we vi(m) users are strange :-)
The README.md has been format and typo fixed.
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.
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.
The program was supposed to print a message that indicates whether you
won or lost but it did not show up because of endwin() being called
after it. To keep the code as close to the original as possible that
part was left in but an additional call to printf() was made after
endwin() is called.
The first alt version removes the maximum number of moves so that
everyone can finish, even people not good at this kind of puzzle. The
second alt version allows you to reconfigure (at compile time) the
maximum number of moves even if you wish to make it harder to win.
Format fix README.md file.
At this time I believe the edits necessary for 1991/rince are complete.
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.
Also since it has been requested that the award + author information be
removed from the README.md files this has been done here as these
changes were already done but not committed. Once the remaining (not
counting this one) five other README.md files have been committed there
will be a mass edit.
This file has not been completely checked but some fixes were made. As
well since it has been requested that the award and author information
be removed from the file, making '## To build:' the first line, this has
been done as these other changes were already made. When all README.md
files have been updated a mass edit will be done for this. There
currently are six others.
I updated the try.sh with a new string that I discovered that is for fun
output especially given something the judges say in the guidelines.
Also since some of the strings are from Brian Westley's entry from 1989
and another one was credited to him I briefly referred to the entry as
well.
Fixed cases where there was a bad trailing backslash.
Improved a few cases where a code block was needed
to highlight some text.
Changed a few cases where a code block needed to
declared as, say, a sh code block.
Fixed a few cases where the winner information was not properly formatted.
Plus a few nits and clarifying text was added.
As the definition of a bug and feature was changed numerous times the
feature or bug of if a file could not be opened for reading or a file
could not be opened for writing was actually fixed to not crash. This
has not been done in other entries and almost certainly won't be but
with this one it was done (recently when there was a change of bug
status in several entries as how the bugs.md file being referred to in
the README.md files was improved) so this has inconvenient feature was
removed from the README.md file. It was not noted in the thanks file
either so that has been updated as well.
We introduce a bit of fun, while specifying that something
is "supposed to happen".
NOTE: There is no need to change the INABIAF STATUS. The use
there is perfectly fine.
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.
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.
This took less time than the previous fix (to let it work with clang)
because after stupidly doing the decryption/encryption manually I had
decided to write a simple program that does it instead.
Now systems won't whine about gets() being unsafe.
The thanks file further documents how this was done and the bugs.md file
no longer has this entry.
The entries referenced in `bugs.md` now have, below the
"To build:" section, a "Bugs and (Mis)features section text"
that matches the `bugs.md` status.
Several entries had their "STATUS" changed from:
"STATUS: INABIAF - please **DO NOT** fix" to:
"STATUS: known bug - please help us fix":
This was done because, while some of the bugs were minor,
inviting someone to try and fix the issue does nil harm.
In a few cases a more difficult bug was also changed to
the "please help us fix".
While we do NOT want to waste time fixing such entries NOW,
letting others become involved and to try to fix the entry
is a good thing as to encourages people to study the entry
and try to fix the entry. We don't need to accept a fix
that is offered, and of the fix transforms the source in
a less than desirable way, such a fix (if accepted) could
be become a alt source code.
This is because they are under the try section. I'm aware that there's a
script called try.me.sh but that's not been decided on a name change. It
probably should be changed to try.sh to be consistent and probably will
be but it's not been yet.
The manifest files in tmp/ have been updated as well, including the
macOS Numbers file.
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.
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.
Although one could get away with saying 'aboard' to mean 'getting on a
ship' ('I climbed aboard the ...') it's probably better to say 'board'
as the verbal form especially in the way it was and is worded (now 'You
board ...'). I believe I already did this change in 1990/dds/LANDER.BAS.
Looking at the author's remarks (which I hadn't checked yet) I was able
to determine how to get the code to disable warnings when compiling the
generated C code. The text
!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo
had to be added to the string 'q' and then
system(q-6);
had to be changed to
system(q-69);
to disable the warnings that clang (at least in macOS - not sure
elsewhere) ended up being errors due to the forcing of -Wno-error.
An important point is that the placement of that text does matter due to
the code:
*o=fopen(q-3,"w");
If the file name is not at the end then what will happen is the 'a.c' file
will not be created as the end of the string 's' will not be (when
decrypted) 'a.c'. At that point the compilation would fail as there is
no file to compile that is created. Thus the end of the string has to
be:
!.Xop.fssps!.Xop.sfuvso.uzqf!.Xop.jnqmjdju.gvodujpo.efdmbsbujpo!b/d
With this the file can be generated and compiled with both gcc and clang
even if -Werror would otherwise cause problems.
The alt code has been removed and the Makefile no longer has alt code
nor does it have the 'a' rule.