6 Commits
Author SHA1 Message Date
Cody Boone Ferguson 9c4ca9603b Fixes in 1987/lievaart
The optimiser was left disabled by accident.

Check for !isdigit(*A) before using atoi(3) on A. This was part of the
bug fixes I made (infinite loop flooding the user with invalid input
which is frequent if one does not know how to play or if one makes a
typo). This is in both versions, the one with the board and the entry
itself (the board being too big to fit in the contest size limits of the
time).
2023-12-19 06:00:37 -08:00
Cody Boone Ferguson 7b1ed2bc94 Properly fix 1987/lievaart invalid input checks
Now the game will re-prompt the player if invalid input is entered both
for the level and for the move. The way it was fixed is described in the
thanks-for-fixes.md file but here is a summary of the previous problem
and the fix.

If one entered an invalid level it proceeded to prompt for the move.
Thus if one entered '.' or anything other than a number it would still
move on. As for the move if one entered invalid input it would prompt
again but in an infinite loop, not letting one enter anything and
instead flooding the screen. The format specifier was thus a '%d'. Now
it's a '%2s' on a 'char A[100]'. After the scanf() it uses atoi(). For
the level it checks if > 10 || < 0 || !isdigit(*A) and if the if is 1 it
goes back to prompting the level. Of course since '-' is not a digit the
check for < 0 is superfluous but I did it anyway. Now prior to prompting
the level it zeroes out 'A' (*A='\0'). For the movement the do..while
loop condition checks for invalid input but it needed a scanf() with
"%2s" also and then use atoi() on the string (A). But in that case there
was no need to zero out the string (might not even be in the other but I
did it anyway).

Now as far as the level goes I checked for > 10 only because later in
the code it checks for < 10 and if so it increments it by 2 so I presume
that it's invalid if it's >10. This might or might not be correct but I
do not know the rules of the game and neither do I know the author's
intentions.

One more important point is that it does seem to stop playing the game,
making the same move again and again, but this might be another problem
or maybe it's a draw or something else. As I said I don't know how to
play the game so I can't verify it either way.
2023-10-20 05:09:18 -07:00
Cody Boone Ferguson 0262590956 Commit missing files in 1987/lievaart fix 2023-10-19 05:19:00 -07:00
Cody Boone Ferguson c13a4ffc92 Make 1987/lievaart slightly more like original
Restored the #define D define even though it can't be used with modern
compilers, just so it looks as close to the original as possible. This
goes for both versions, the one with the board and the entry (limited by
the contest restrictions).
2023-10-18 05:12:54 -07:00
Landon Curt Noll 7ecd9a9514 Update & reformat 1987 in 1984 style 2022-09-21 03:03:53 -07:00
Landon Curt Noll c0663537cb Add preview of 1984-2019
The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.

One will find HTML commented out with:

    <!-- XXX remove when 2020 is ready
    2020 links here
    XXX remove when 2020 is ready -->

The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks.  Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known.  The following files
have such HTML comment blocks in them.

    ./winners.html
    ./years-spoiler.html
    ./years.html

In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.

The 2020 winner code AND write-ups are NOT part of this set.

p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
2020-12-30 16:57:03 -08:00