335 Commits
Author SHA1 Message Date
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
Landon Curt Noll ea1806abdb change Makefiles to look under X11_INCDIR and X11_INCDIR/X11 2023-03-26 02:22:49 -07:00
Landon Curt Noll 5fc2d72dd1 change use of ${HOMEBREW_PREFIX} with ${SDL2_CONFIG} 2023-03-26 02:19:18 -07:00
Landon Curt Noll 8cd2aa85c1 clean up and improve end of Makefile rules 2023-03-26 02:02:31 -07:00
Landon Curt Noll d04e6d8f03 remove X11_LIBDIR and X11_INCDIR setting from Makefiles
The X11_LIBDIR and X11_INCDIR values are now set in the
top level `var.mk` file.
2023-03-26 00:50:47 -07:00
Landon Curt Noll bbd18a20df improve Makefile headers
Simply the Makefile header.

Refer to the //www.ioccc.org/bugs.md URL (that will eventually exist).

Now using CC BY-SA 4.0 License to how you may share and adapt the
Makefile.
2023-03-25 23:51:14 -07:00
Landon Curt Noll 9e1b0ac82f fix common tool locations header lines in some Makefiles 2023-03-25 22:31:02 -07:00
Cody Boone Ferguson 7e0a25eb4a Add thank you to 1989/jar.2/README.md
Since I've done for most fixes I've made (and all for Yusuke Endoh) I
have referred to me as the one fixing this entry.
2023-03-25 09:31:25 -07:00
Cody Boone Ferguson 63ddcb46fd Reword thank you in 1989/fubar/README.md
I made it closer to how I put it in the other entries that I (and in
other cases Yusuke Endoh) fixed. This is merely a cosmetic change.
2023-03-24 03:26:43 -07:00
Cody Boone Ferguson 4614d2a4bb Fix Westley's entries (dead link, .gitignore)
The main link was dead but looking at the Internet Wayback Machine I
found that he changed domains and it's still valid. One entry had a
different URL but with a quick check I could not determine that it had
anything to do with him so I changed it to his own domain (which I
verified is his).

The 2001/westley/.gitignore was also updated as it has other source
files that are generated by the commands in the try section.
2023-03-20 08:52:19 -07:00
Cody Boone Ferguson fa682003eb Fix typos, formatting and thank yous (add links)
In some files changed the formatting was fixed to be a proper markdown
file.

There were some typos including that some README.md files that linked to
/winners.html#Cody_Boone_Ferguson actually linked to the non-existent
file /years which obviously would not work.

I also added links to the rest of the places I have fixed entries (but
see below) and I did the same for Yusuke Endoh's fixes.

As well apparently one entry I thought he fixed to compile under modern
systems does not seem to so that entry will have to be revisited another
time. That entry was 1993/jonth.

Those are the main changes here if not all of them.
2023-03-18 05:16:31 -07:00
Cody Boone Ferguson d4ef163cc4 Various README.md files updated
Mostly formatting fixes but some typos were fixed as well. This commit
is being made now so I can roll back
ad04d21fda as it seems to have been a
mistake to do. Another way to more easily identify same authors will
have to be figured out, perhaps in future files that are yet to be
generated. This upcoming commit will hopefully not cause any problems
but if there are any they will be worked out.

Landon and I both came to the same conclusion that although the renaming
directories seemed to have been warranted in theory they shouldn't have
been renamed after all. This was briefly discussed in issue #3. Anyway
this is why different years are in this commit: to get them out of the
way and since they're only README.md files this seems okay to do.
2023-03-17 07:17:10 -07:00
Cody Boone Ferguson 892b94c5a6 Get 1989/westley to compile with clang
Some important notes here should be made. First of all with clang the
recommended commands in the README.md (which was also formatted and typo
fixed) will seemingly generate the correct files but still only
westley.c and ver0.c will compile with clang. With gcc they do compile
and seem to work as expected.

However I found a bug in the original code too where ver2 will sometimes
segfault. This also goes for the fix (again when compiled with gcc).

I did get ver[123].c to also compile but this seemed to cause invalid
output in some of the commands. That being said it might (though I don't
think so at this time) have been not knowing exactly what should be
displayed. Maybe I will look at it in the future but at least it now
works with clang even if not all of the generated files will compile
that way. Still macOS users can now take a look at the different output
of the program which seems good to me (it does not even have to be
source code that is output).

These things have been noted in the README.md as well.
2023-03-17 06:55:06 -07:00
Cody Boone Ferguson d0177f7172 Minor updates to 1989 files
Mostly this involves README.md files in some entries but the
1989/robinson/Makefile was updated. Force -include option in CINCLUDE
variable not CDEFINE.
2023-03-16 10:25:16 -07:00
Cody Boone Ferguson 0f798012d5 Minor fixes to 1989/tromp - now compiles cleanly
Now compiles without any warnings triggered (though it has some -Wno- at
the compiler). Some of the -Wno- options were removed from the Makefile
as they are no longer needed. I did not check all the ones that are
remaining but some are certainly needed (including some I tested).

Also force use of -include stdio.h -include unistd.h -include stdlib.h
by minor change to Makefile. The last one, -include stdlib.h, was newly
added.
2023-03-16 03:50:02 -07:00
Cody Boone Ferguson 2c7cc31065 High score file and other bug fixes in 1989/tromp
Previously after the game ran the game segfaulted and the high score
file HI was not created. Now the file is created and sorted so that the
highest score is at the top. This file was not even created because 'd'
was an int and not a FILE * (to show how much has changed over the
years!) which popen() returns.

It seemed that popen() could not have the stty re-enabling of echo
either so it's now in a system() call (it might have been because of a
problem I later fixed as described below).

But reinstating echo did not work right and in fact one could not even
type the character 'u'. The important changes here are:

- 25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo stop u");sigaction(14,v,
+ 25||i%12<2?7:0;srand(getpid());system("stty cbreak -echo");sigaction(14,v,

and

-0);while(getchar()-a[4]);puts("\033[H\033[J\033[7m");sigsetmask(s);}}d=popen(
-"stty -cbreak echo stop \023;cat - HI|sort -rn|head -20>/tmp/$$;mv /tmp/$$ HI\
-;cat HI","w");fprintf(d,"%4d on level %1d by %s\n",w,l,getlogin());pclose(d);}
+8192);printf("\033[H\033[J\033[0m%ld\n",w);if(c==a[5])break;for(j=264;j--;Q[j]=
+0);while(getchar()-a[4]);puts("\033[H\033[J\033[7m");sigsetmask(s);}}system("\
+stty cbreak echo");d=popen("cat - HI 2>/dev/null|sort -rn|head -20>/tmp/$$;mv /tmp/$$ HI\
+;cat HI","w");fprintf(d,"%4d by %s\n",w,getlogin());pclose(d);}

Now a word about these changes and in particularly the assignment to l
and the fprintf(d, ...):

-V;{char *a;*v=(long)t;h[3]=1000000/(l=C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i<
+V;{char *a;*v=(long)t;h[3]=1000000/(C>1?atoi(V[1]):2);for(a=C>2?V[2]:"jkl pq";i;i--)*n++=i<

and

-;cat HI","w");fprintf(d,"%4d on level %1d by %s\n",w,l,getlogin());pclose(d);}
+;cat HI","w");fprintf(d,"%4d by %s\n",w,getlogin());pclose(d);}

If you notice in the fprintf() call the 'l' is no longer referenced - no
level is noted. Why? This is because it was never changed aside from the
initial assignment of

	 l=C>1?atoi(V[1]):2

so there was no point in having the level as the argv was not for a
level but rather drops per second and command string. Thus the high
score (that is now created and updated - up to 20 entries) looks like:

	N by user

where N is the score and user is that from getlogin(). I noted this in
the README.md file.

I also gave a 'Try:' section in the README.md and noted the additional
bug fixes. As well I noted the alternative code which is put in
tromp.alt.c but the unmodified original alternate code which will not
work with modern compilers. Why not fixed? Because doing so the high
score file still was not created even when made to compile okay so I did
not see the point. Perhaps an older compiler will work anyway.

There were two include files that needed to be added which is done via
the compiler option -include: stdio.h and unistd.h.

Now 1989/tromp should work without a segfault, without disabling echo
(or the u key) and with a high score file with up to 20 entries!

One other change with the README is I removed the section 'Bug fix thank
you' as that was redundant: it was already at the top in the how to
build section which seems to be a better place. If nothing else it is
consistent with the others. However I added the links to both Yusuke and
me in the winners.html file like Landon had put int (the other files
with fixes needs the links as well). Of course if it's ideal to have a
separate section (maybe a subsection of how to compile) I will be happy
to find the files that need to be changed and do that.
2023-03-15 08:51:17 -07:00
Landon Curt Noll a91ac11c65 moved 1989/tromp fix thank you from years.html to README.md 2023-03-08 03:35:41 -08:00
Landon Curt Noll 46235a4b3b Merge branch 'master' into 1989 2023-03-08 02:59:01 -08:00
Landon Curt Noll d1bb558f70 fix how alt code is used in 1989/jar.1
Turned *.sh files into executable bash scripts.
2023-03-08 02:24:23 -08:00
Cody Boone Ferguson 49aaec4940 Remove now false comment in 1989/tromp/Makefile 2023-03-06 13:32:41 -08:00
Cody Boone Ferguson 8f752fe565 Add another note to 1989/fubar/README.md
The same problem with an infinite loop will happen with larger numbers.
2023-03-06 09:22:49 -08:00
Cody Boone Ferguson 2528faef14 Add note to 1989/fubar/README.md
Don't run ouroboros.c directly or it'll get stuck in an infinite loop.

Also moved the author's comments to the first column of the file.
2023-03-06 09:16:36 -08:00
Cody Boone Ferguson be9cd12e53 Update 1989/fubar/.gitignore
When successfully running the program it creates the files x and x1.
2023-03-06 09:12:00 -08:00
Cody Boone Ferguson 0a9e468e8d Add HI to 1989/tromp/.gitignore
The entry creates it upon the program ending. That part of the entry
does not work with modern systems but it should be excluded from the
repo nonetheless.
2023-03-06 09:08:43 -08:00
Cody Boone Ferguson 9d63c37f49 Get 1989 entries to compile
There were some which cannot be compiled under clang. One entry we used
a patch from Yusuke Endoh to get the entry to compile; thank you Yusuke
for your assistance! Another one we used a patch from Yusuke (thank
you!) but I further fixed it so that it would work with clang. It had to
be done: IOCCC Tetris has to work! This was done by changing the
environment arg to main() to be a char * in main() itself rather than a
char **. Using a char ** in main() third arg got it to compile but only
one key worked with clang so I changed it to be not the third argument
but a regular char * in main(). **a (third arg) evaluated correctly but
*a[1] and onward was actually part of the environment. Again IOCCC
Tetris has to work!

I also fixed fubar to work which took a few tweaks.

README.md files were also updated.
2023-03-06 09:04:46 -08:00