From 5c68fa8f665bac676ab550cb93d8e6aca212f918 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 19 Oct 2023 04:45:32 -0700 Subject: [PATCH] Fix 1987/lievaart - check for invalid input It was documented that the program detected invalid input but it actually (now - it used to work) printed in an infinite loop 'You:'. Now doing invalid input forfeits the game which is better than flooding the screen. It is not yet clear if it should act like you put in 99 (see the README.md for details) so this is in bugs.md just in case. If it is supposed to just skip a move then this can be fixed but otherwise it can be removed from bugs.md without any change in the code. This fix applies to both versions, the one with the board display and the original entry (with contest restrictions on size of code). --- bugs.md | 12 ++++++++---- thanks-for-fixes.md | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bugs.md b/bugs.md index 94f423104..6a6c71f1c 100644 --- a/bugs.md +++ b/bugs.md @@ -537,12 +537,16 @@ or any others. # 1987 ## [1987/lievaart](1987/lievaart/lievaart.c) ([README.md](1987/lievaart/README.md)) -## STATUS: INABIAF - please **DO NOT** fix +## STATUS: possible bug (possibly depending on system) - please help test and if necessary fix -Two issues to be aware of: if you input invalid input (as in invalid characters -like `.`) it might enter an infinite loop printing the same thing over and over. -Also if you don't enter a valid number it will prompt you again. +Cody fixed this to not enter an infinite loop (it was documented to detect this +but it no longer worked). However this will forfeit the game for the user and +it's not clear at this time if it was supposed to just act like you input `99` +(see the README.md for details here) but that seems probable. +Another issue might be that certain input when prompted for input will just +prompt you again for input but it might be that I (Cody) do not remember how to +play the game and it's expected this way. # 1988 diff --git a/thanks-for-fixes.md b/thanks-for-fixes.md index 2f5a6d2ca..bb7b22eb5 100644 --- a/thanks-for-fixes.md +++ b/thanks-for-fixes.md @@ -290,7 +290,10 @@ that for System V we had to do this) Cody added to the Makefile ## [1987/lievaart](1987/lievaart/lievaart.c) ([README.md](1987/lievaart/README.md)) -Cody made this ever so slightly like the original code by adding back the +Cody fixed two infinite loops showing just `You:` by detecting invalid input +which the program was documented to do. But see [bugs.md](/bugs.md). + +Cody also made this ever so slightly like the original code by adding back the `#define D define` even though it's unused. This was done for both versions as well (the one with the board and the one without, the entry itself with the limitations of the contest).