Commit Graph
109 Commits
Author SHA1 Message Date
Cody Boone Ferguson db6b154b70 Fix 1989/jar.2
There were some things unclear in the README.md file that have now been
corrected.

Clarified in the README.md that running make clobber all will run the
program itself.

The make alt target now runs the alt code just like the entry itself.
This is fine because it is a simulation (to avoid annoyance of writing
binary data to /dev/tty) and since one may still run the program or
script directly it's fine.

The alternate code section in the README.md was cleaned up and formatted
as well.
2023-10-20 05:58:08 -07:00
Cody Boone Ferguson 0315dcba75 Minor fixes in 1989/tromp/README.md
This has not been format/typo checked yet.
2023-10-19 10:27:49 -07:00
Cody Boone Ferguson 53b1c5491b Minor format fixes in 1989/jar.1/README.md
This is not complete as some things are not clear to me at this time. I
just fixed some things that could be fixed without looking over the full
file, just updating what was immediately noticed.
2023-10-19 10:01:54 -07:00
Cody Boone Ferguson 3ed32862d8 1989/fubar updates
Format fix the README.md file including removing some '\'s at end of
lines (in the remarks).

Document feature that if the arg is a large number or < 0 (the latter of
which I discovered a few minutes ago as I was working on this) it will
enter an infinite loop trying to compile code that has syntax errors.
This was noted by the judges at the time so it is not a bug but a
feature. This has been added to the bugs.md and the README.md file.
2023-10-19 09:53:28 -07:00
Cody Boone Ferguson f882ea84dd Fix infinite loop in 1989/ovdluhe
As Landon said it is a bug (after I asked about it) I have fixed it.
Without this fix the program printed the same thing over and over again
in some cases. The problem was a for() loop that didn't always have the
pointer incremented. It looks like I could have got away with just
updating the increment part of the loop but I didn't do that as I didn't
see it at first.

The optimiser was disabled. That might not be strictly necessary but I
had it disabled for a time so I have kept it disabled.

Also I removed my name in the README.md: this was missed when the much
better idea of a general thanks file was come up with. When testing the
fix I came across part of my name which made me check. I have not yet
typo/format checked this file or any of 1989 so that was not done. That
might or might not happen in part or in whole later today but either way
it'll be started soon.
2023-10-19 05:19:58 -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 6625034139 replace trailing whitespace with blackslash in README.md
As an alternative to the markdown trailing whitespace as a line
break, we use a trailing blackslash as a markdown line break.
2023-10-18 15:49:51 -07:00
Landon Curt Noll f9750f114a fix improper use of whitespace in README.md files
The use of the markdown trailing whitespace to indicate
line break should NOT be done when the following line is empty.

This removes such improper use of whitespace in README.md files.
2023-10-18 15:33:10 -07:00
Cody Boone Ferguson 0942f4e6b2 Mass typo fix in Makefiles
There was a comment in the form of:

    ... the liked/allowed ...

which should instead be:

    ... liked/allowed ...

and this was fixed with my sgit tool like:

    sgit -e 's,the \(liked/allowed or compile\),\1,g' '*Makefile'
2023-10-16 10:35:34 -07:00
Cody Boone Ferguson ffdf581218 Mass typo fix in Makefiles
With the make indent rule there was a typo for indent as 'intent'. This
was fixed with my sgit tool like:

    sgit -e 's/no intent\( tool found\)/no indent\1/g' '*Makefile'
2023-10-15 12:18:34 -07:00
Cody Boone Ferguson 73fc551f70 sgit -e 's/Un\*x/Unix/g' -e 's/UN\*X/UNIX/g' .
This is not only to help with formatting - especially important in
markdown files -  but it's no longer really necessary to do it. One
might not feel the need to do it in non-markdown files but I did it
anyway to be consistent. Thus instead of showing Un*x/UN*X it shows
Unix/UNIX.

A question of whether or not it should all be the same case is another
thing entirely but if this is desired at some point it should be easy to
do anyway - with some care in case it's in formatted text.

A note about the glob: why '.' when there are C files and other file
types where it could be dangerous to modify? Because I did a git grep
first so I knew that it was safe.
2023-10-11 05:16:15 -07:00
Cody Boone Ferguson add7268842 Format fix 1980s and 1990s README.md files
I also updated the todo.md file as I left some things out that have to
be done. I only explicitly named one thing but when I go over them as a
final pass I will address the things in question (some will require
discussion).
2023-10-10 06:24:13 -07:00
Cody Boone Ferguson 71eed0c674 Add important note to 1989/fubar/README.md
In the judges' remarks they refer to ouroboros.c as being an executable
but it's not in the repo. This is because it's created by the program
itself. It happens to be in .gitignore but this note should make it less
confusing and prevent people from thinking that a file is actually
missing.
2023-10-07 07:52:48 -07:00
Cody Boone Ferguson 4ef3afcd74 Updates to 1989/westley
I have tried to make the README.md file less cluttered wrt the clang
defects and instead just show how to use the entry, referring to the
bugs.md for those who need to know.

Added script compile.sh which generates the files and tries to compile
them. The script sleeps (by default approximately 1 second) in between
commands but this can be changed to another value (including 0). One can
also change the compiler path in case their compiler is clang or in the
case of macOS gcc IS clang. The README.md refers to this and gives
examples.

The bugs.md and the thanks-for-fixes.md files have been updated for
these changes and additions.

For those who do not know of the clang defects it is discussed in the
bugs.md and unfortunately for this entry there might be little that can
be done. I haven't tried to understand the entry deeply and maybe doing
so would give some ideas for fixes (beyond what I already did which lets
the main program compile with clang - or at least versions that allow a
fourth arg to main()) but this seems less important for now.
2023-10-07 07:10:06 -07:00
Cody Boone Ferguson ef456bfb1e Mass typo fixes
This is a HUGE commit:

    417 files changed, 874 insertions(+), 874 deletions(-)

As the IOCCC website now is https enabled I have updated the
'http://www.ioccc' to 'https://www.ioccc'.

There was also a typo in Makefiles where it said 'for VERY WELCOME' when
it should be 'are VERY WELCOME'.

Finally slashdot.org is also https enabled so references to
'http://slashdot' were changed to 'https://slashdot'.

This was done by my sgit tool (see https://github.com/xexyl/sgit)
like:

    sgit -e 's,http://www.ioccc,https://www.ioccc,g' -e 's/for VERY WELCOME/are VERY WELCOME/g' -e  .

but because I didn't have a list of files that should be modified I had
to be careful which files to commit as I had files that were changed but
not ready to be committed. Since I did it in steps, finding typos as I
went along, I actually ran sgit three times but to simplify the above
(and to show that it's possible to do more than one sed command) I made
it all as one. Since I did not have a list of files ahead of time I had
to determine what files to commit, first going through them like:

    for j in $(for i in $(git status|grep modified|cut -d: -f2); do \
	git grep 'https://www.ioccc' "$i"; done|cut -d: -f1|sort|uniq); \
	do git diff "$j"; done|less -r

(I had to pipe through less because of a strange problem with the git
diff which appears to be because of a terminal problem maybe due to the
command above but it was all I could come up with in a very tired head.)

The above and

    git status | grep modified:

showed that some C files had been modified which obviously should not be
done so I had to do:

    git co '*c'

to undo those changes.

Finally to commit the correct files I did:

    for i in $(git status|grep modified|cut -d: -f2); do \
	git grep -E 'https://www.ioccc|https://slashdot|are VERY WELCOME' "$i"; \
	done |cut -d: -f1|sort|uniq|xargs git commit -v

or so (with any formatting issues or typos here due to typos in the log
due to the terminal (in)sanity issue described).
2023-10-07 04:35:47 -07:00
Landon Curt Noll 3ea4297ac4 improve clobber rule for 1989/westley 2023-08-04 17:18:53 -07:00
Cody Boone Ferguson 1d86daf19a Change LIBS to LDFLAGS in Makefiles
This is to make it more standard which further allows one to run make on
some other source code, say because they want to try and fix an entry
but forget to update the Makefile. Or if they're the author they can not
worry about it in some cases. But since LDFLAGS is the standard way it
seems better to have the LIBS variable in the Makefile be LDFLAGS.

Maybe there is a reason to not have this and I'm happy to close this in
that case but it does seem better this way so I'm doing this commit.
2023-07-10 03:33:53 -07:00
Landon Curt Noll 19f3263d8e improve .gitignore for 1989/jar.1 2023-07-09 14:10:31 -07:00
Landon Curt Noll 606020a0c1 fix tty annoyance of 1989/jar.1
Instead of writing the literal output of the binary to /dev/tty,
we simulate the output by silencing stderr and by piping the binary
thru strings.

The raw binary executable output to /dev/tty was capable "ill effects".
Such "ill effects" could be as mild as printing strange characters, to
beeping (sometimes for extended periods), and even the termination
of the terminal app window in some cases.

The "ill effects" from the printing of the raw binary executable
is highly dependent on the compiler, compiler version, libc, crt0.o,
operating system, terminal app and/or terminal driver.  As such,
the "ill effects" that one user might see may be hard to reproduce
in order environments.  While some of the more extreme "ill effects"
might be unlikely, what was more common was for the binary output
to be interpreted strangely by the terminal app and/or driver to
the extent that the was lost or not well seen by the user.

This change introduces the ${STRINGS} Makefile variable to the
`/var/mk` file and uses to to "clean out" any output that might
produce such "ill effects".  Prior to the command, the echo does
clearly state:

```
NOTE: We will now simulate: cc -c -o /dev/tty jar.1.c
```

We also modify the `1989/jar.1/jar.1.sh` and `1989/jar.1/jar.1.alt.sh'
shell scripts to pipe raw binary through strings as well.

Thus the user can, if they wish, try the raw command themselves.
If that command does produce the more extreme examples of "ill
effects", the fault rests with the user.  We mention that the
Makefile will echo the command to stdout in the `README.md`.  But
that is as far as we go.  We do **NOT RECOMMEND** having a shell
script or Makefile rule that would write the raw binary to `/dev/tty`
but rather let the immigration of the user try or not try it.

In general, the use piping raw binary thru stings makes the original
output more apparent, as was the case when using dumb CRT terminals
that couldn't even process ANSI escape sequences were more common.
2023-07-09 13:55:14 -07:00
Cody Boone Ferguson 19d7c1fe7f Fix funny problem in alt target in 1989/westley
In linux running make ver1 and make ver2 and make ver3 (not sure about
ver0 now) there was a strange error when running the rules that meant
the code was not compiled. Thinking on it just now it very likely was
the exit code of the program causing the problem but the file was
generated so I added a '-' to the line so that the rule will proceed to
try and compile the code.
2023-07-08 06:04:34 -07:00
Cody Boone Ferguson b6330673cc Restore silencing warnings in macOS
As besides the entries that are not supposed to compile/cannot compile
due to architectural limitations all the entries can compile in macOS
(though some do not work - yet(? I have plans to work on more later)) it
was not necessary to not silence the warnings after all as the entries
that don't work will be easy to identify ('they don't work' :-) ) so I
can just do make CSILENCE= all in the directory of those entries which
solves the problem I had originally thought of.

Some of the Makefiles have retained other changes I had to make
yesterday to get the entries to work with clang in linux but most of
them were either not changed or were made better with the rollback of
the commit that originally silenced warnings.

Now work on silencing warnings for linux can be done.
2023-07-08 05:05:50 -07:00
Cody Boone Ferguson d89305ef3b Mass .gitignore update for .orig.c files
Due to the fact we now have .orig.c files and thus the possibility of
winner.orig or prog.orig being built I have updated all the .gitignore
files so that these files ignored. This was done with the following
shell commands, for reference:

    for i in $(find 19* 200* 201[0123] -mindepth 2 -maxdepth 2 -name .gitignore) ; do echo $(dirname "$i"|sed -e 's,[0-9]\{4\}/,,g').orig >> "$i"; done
    for i in $(find 201[4-9] 2020 -mindepth 2 -maxdepth 2 -name .gitignore) ; do echo prog.orig >> "$i"; done

and the two commands is because it was only in 2014 that the winning
entries were renamed to prog so prog.orig is the correct glob.
2023-07-08 04:39:42 -07:00
Cody Boone Ferguson 2d326bd53b Fix 1989/ovdluhe/Makefile for clang in linux
Makefile:90: *** recipe commences before first target.  Stop.

This happened due to a typo which left off a \ before a newline where
it is meant to be one line.
2023-07-07 10:41:31 -07:00
Landon Curt Noll 2aa99f0644 revert commit d8425bb767 2023-07-07 05:36:08 -07:00
Landon Curt Noll d8425bb767 silence warnings under macOS for cc, clang and gcc
Used the following script to check for warnings
not silenced via ${CSILENCE}:

```sh
find ???? -mindepth 1 -maxdepth 1 -type d | while read dir; do
(cd "$dir"; echo =-=-= "$dir" =-=-= ; csilence -v 1 clobber all ; echo ; csilence -v 1 clobber alt)
done 2>&1 | less
```
2023-07-07 01:11:22 -07:00
Landon Curt Noll 2ba12ecc3c restore *.orig.c to each entry
Under each yyyy/dir there is a file of the form '*.orig.c'
containing the original source code, or as close as we can
get to the original source code.
2023-07-06 21:49:38 -07:00
Cody Boone Ferguson 5d1b739100 Remove duplicate alt rule in 1989/westley/Makefile 2023-07-03 11:48:05 -07:00
Cody Boone Ferguson 951c052776 Improve how 1989/westley alt versions are built
The Makefile now has the other versions as alt targets. Running make
ver0 will generate ver0.c and then try compiling it. Running make ver1
will do the same for ver1.c and running make alt will do this on ver0,
ver1, ver2 and ver3. Error in compilation in these rules are not fatal
so that make alt can continue. This is important for clang.

I have some other enhancements on the presentation of this entry but
they have to be reworked and decided upon (it might be that it's not
necessary with the alt rule but then the README.md file really ought to
be updated too which it will be in another commit).

It might be that making these alt targets is not even the right approach
but for now it'll do as at least it's easier to generate and compile the
individual files even if one does not use make alt. This is all TBD
later.
2023-07-03 05:05:42 -07:00
Cody Boone Ferguson a7f9a722fc Fixes in 1989/westley
Try and improve the note during compilation that some versions will not
work with some compilers.

Make the other versions alt code. Running make alt will stop on the
first error but I made it alt targets so that make clobber will remove
the compiled files. In order to make it actual targets the Makefile
would have to do more to generate the files and this might or might not
be better.

Format fixes and a typo fix in README.md.
2023-07-01 08:23:13 -07:00
Cody Boone Ferguson a981cacbee Begin centralising thank yous to a single file
NOTE: this is just one way to fix the problem described below but it can
be modified - perhaps greatly changed - or rejected and done
differently. That being said it does isolate the entries that can be
modified except for the one by Simon Cooper as I had intended to do all
entries before a commit but I am too tired to continue and there are
more important things to be done for the IOCCC (hopefully later today).
I don't mind but I wanted to save Landon some of the work as I started
the problem even though all with good intention after Landon noted he
wanted to thank those in the README.md files.

First I would like to also apologise to any previous winners if there
was upset or concern; this was all done with the best intentions and I
know that it was a fine line but the judges' goal is to make it so
previous entries do work in modern systems so that everyone can enjoy
them. Still I am sorry if I caused any offence or anything else! I
actually agree with the situation and I had been wondering about how to
go about it too. Now for the rationale behind this update.

A couple previous winners have voiced concern about the way the thank
you notes are displayed in the README.md files I have started the work
to save Landon some of the trouble as although it was with good
intentions (and based on the note that Landon wanted to thank those who
fixed an entry) I started the problem so it seems only right that I help
rectify it. I also agree with the problem and had thought of it before,
even thinking that in some entries it needs not have any reference to
anyone but the winner! This commit has removed the thank you notes from
several entries and added a THANKS.md file.

The THANKS.md file has the rest of the entries that were fixed as well
which should if nothing else help isolate the entries that need to be
modified. Some entries actually referred to me but were not a thank you
note due to a fix; some were from winners themselves for instance.

Note that I did not update the bugs.md file or any other file that might
refer to these things in the README.md files. The bugs.md for instance
refers to adding credits to those who fix problems or provide missing
links or files to the respective README.md files and this will have to
change once the way this is done is finalised. But hopefully this is a
help to Landon so that he may also focus on the important jprint tool in
the mkiocccentry repo.
2023-06-06 04:50:41 -07:00
Cody Boone Ferguson d235b565df Fix consistency of award titles
This was done quite easily with a bit of thought. I generated a script
that could be modified in vim if necessary (as it turned out to be
though some of it could have been generated too but I did not think of
everything at once and it is a hack).

This is how I generated it:

    echo '#!/bin/bash' > bin/check_awards.sh ; ( while read -r g ; do echo grep "$g"; done < <(sed -e 's,_,/,g' -e 's/"/\\"/g' tmp/year-auth-prize.csv | awk -F, '{print grep "\x22" $2 "\x22" " " $1 "/" "README.md"}' ); ) >> bin/check_awards.sh

Then I I modified the file (again this was a hack to make it easier and
quicker and better for being tired too) in vim to make the grep use -Hc
so I could pipe it to 'grep :0'. This found the files without the right
award. So the final command was:

    sh bin/check_awards.sh |grep :0

though I did have to edit some files several times.

For reference the script has been added to the repo too but with +x
permissions.

This change also required updating the CSV file in tmp/.
2023-05-13 07:02:07 -07:00
Landon Curt Noll 5927927e51 Add .id to all winning entries 2023-05-13 11:45:33 +10:00
Landon Curt Noll c69445d067 Add .top and .year files
This will be used by tools that will build the web site
and tools that form JSON files (such as `.winner.json').
2023-05-12 20:10:38 +10:00
Cody Boone Ferguson 66231b2150 Remove 'America' (A) from 'USA' :-)
This to make the country code consistent with mkiocccentry (and I guess
international standard country codes).

This affects many README.md files and (for one line) winners.csv.
2023-04-22 04:21:38 -07:00
Cody Boone Ferguson f458d5aefe Update 1989 winning entries' README.md files
Format and typo fixes.
2023-04-14 06:20:49 -07:00
Cody Boone Ferguson fcb19507a8 Add alt code to 1989/ovdluhe + update README.md
The alt code is based on the author's remarks. It allows one to more
easily redefine the macro they refer to (P) in a way that lets them try
it out without having to modify the code.

Updated .gitignore.

Format fixes in README.md.
2023-04-14 05:57:04 -07:00
Cody Boone Ferguson 9e323d8392 Remove colon at end of award in README.md files
As in

    sgit -e '1s/:$//g' '*README.md'
2023-04-11 08:43:41 -07:00
Cody Boone Ferguson 4bf3f302cb 'comments' -> 'remarks' in all README.md files
As in

    sgit -e 's/\([Aa]uthor.*\)comments/\1remarks/g' -e 's/\([Jj]udge.*\)comments/\1remarks/g' '*README.md'
2023-04-10 11:01:39 -07:00
Cody Boone Ferguson 2d7cfef50c Add crash warning to 1989/robison
With invalid digits the program will crash. This was never fixed (nor
should it be) but never noted either.
2023-04-07 10:57:11 -07:00
Cody Boone Ferguson e09f677b37 Mass typo fix (all README.md and Makefiles)
As in

    sgit -e 's/the terms this license/the terms of this license/g' '*/Makefile' '*/README.md'
2023-04-02 09:27:13 -07:00
Cody Boone Ferguson e805f41d34 Mass fixes to headers in README.md files
There were many many README.md files with the wrong heading level for
different sections. These have been changed.

To help go through the changes it should be noted I used sgit and also
here is what is changed:

The 'Try', 'To build' and 'To run' lines have two '#'s. Some had one and
others had three.

An exception is that in 1984/anonymous/README.md for the alternative
code that had three '#'s. This is not consistent yet and it might be
that only two are desired. But for now that one at least has three.
2023-03-31 06:43:59 -07:00
Cody Boone Ferguson 6b0cec23d6 Fix segfault in macOS with 1989/paul
The problem was that the int * needed to be a long *. It became apparent
to me when evaluating it with lldb as I noticed a pointer was long, not
an int. This does not cause a problem with linux. I have no 32-bit
system to test but I don't believe this will be an actual problem.
2023-03-27 10:05:01 -07:00
Cody Boone Ferguson 465d4239ed Minor fixes to 1989/ovdluhe/README.md
Split judges' comments to be a to build, try and judges' comments. The
to build section already existed.

Also added ./ in front of the binary name so commands would actually
work.
2023-03-27 09:18:36 -07:00
Cody Boone Ferguson 3ae6bb1116 Fixes to 1989/jar.1/README.md 2023-03-27 09:14:13 -07:00
Landon Curt Noll 58574544da trim Makefile whitespace and fix spaces before tabs 2023-03-26 22:22:16 -07:00
Landon Curt Noll 350da723cc improve architecture and Optimization comments in Makefiles 2023-03-26 22:13:13 -07:00
Landon Curt Noll 0ddcc983ce remove old ${PROG}.orig file related rules 2023-03-26 21:03:54 -07:00
Landon Curt Noll 1c35dc3b47 make everything true :-)
Add @${TRUE} as an action for the everything rule in Makefiles.
2023-03-26 20:47:04 -07:00
Landon Curt Noll e42d7484cd trim comments and update 133t hacker rulz in Makefiles 2023-03-26 20:24:16 -07:00
Landon Curt Noll 1b1dd2f2e4 put all README.md files under CC BY-SA 4.0 License
This will make is easier for others to share README.md
files while requiring them to attribute the file
when using it.
2023-03-26 02:58:27 -07:00