From 3ed32862d8a4f32da8273e79e26fc35c4e87c284 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Thu, 19 Oct 2023 09:53:28 -0700 Subject: [PATCH] 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. --- 1989/fubar/README.md | 22 ++++++++++++---------- bugs.md | 9 +++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/1989/fubar/README.md b/1989/fubar/README.md index bb3d83770..469dd80e2 100644 --- a/1989/fubar/README.md +++ b/1989/fubar/README.md @@ -25,34 +25,36 @@ make all ./fubar 2 ``` +### INABIAF - it's not a bug it's a feature! :-) + +If you use either `fubar` or `ouroboros.c` (it's executable, see below) with a +number < 0 or larger than, say 20, it's very likely that the program will turn +into an infinite loop trying to compile code with syntax errors. ## Judges' remarks: -Run this with a single digit argument (or wait a long time). +Run this with a single digit argument (or wait a long time and risk an infinite +loop as described above). The blank line at the beginning of the source is mandatory. Do you know why? -NOTE: don't try running `ouroboros.c` (note that it's executable) -directly with an arg as it'll turn into an infinite loop. The same will happen -with larger numbers. - NOTE: the file `ouroboros.c` is created by the program itself so this is why it is not in the repository. ## Author's remarks: In a nutshell, this is probably the slowest and most -obnoxious factorial program ever written. Unfortunately,\ -the name of the C source must be "ouroboros.c"; the name is\ +obnoxious factorial program ever written. Unfortunately, +the name of the C source must be `ouroboros.c`; the name is hard-coded into the program. -The source is a legal shell script and a legal C program.\ +The source is a legal shell script and a legal C program. The shell script compiles itself, and then executes the -resulting binary, giving the source as input. The program\ +resulting binary, giving the source as input. The program works by successively modifying #define lines each pass through. -Both `indent` and `cb` will damage the program, `indent`\ +Both `indent` and `cb` will damage the program, `indent` much more so. ## Copyright and CC BY-SA 4.0 License: diff --git a/bugs.md b/bugs.md index 6a6c71f1c..1914cdd65 100644 --- a/bugs.md +++ b/bugs.md @@ -558,6 +558,15 @@ so, the program drops a core file into the directory. # 1989 + +## [1989/fubar](1989/fubar/fubar.c) ([README.md](1989/fubar/README.md)) +## STATUS: INABIAF - please **DO NOT** fix + +Specifying too large a number (or < 0) to either `fubar` or the source code file +(it's executable) that it generates will cause the program to enter an infinite +loop, trying to compile code with syntax errors. At least in one system any +number larger than 20 did this. + ## [1989/robison](1989/robison/robison.c) ([README.md](1989/robison/README.md)) ## STATUS: INABIAF - please **DO NOT** fix