From cf4437c508c5c0319e7e50ac1af05b170c0563bd Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Fri, 14 Apr 2023 06:24:32 -0700 Subject: [PATCH] Update 1992 winning entries' README.md files Format and typo fixes. --- 1992/adrian/README.md | 20 ++++++++++---------- 1992/albert/README.md | 6 +++--- 1992/buzzard.1/README.md | 18 +++++++++--------- 1992/buzzard.2/README.md | 6 +++--- 1992/gson/README.md | 16 ++++++++-------- 1992/imc/README.md | 6 +++--- 1992/kivinen/README.md | 16 ++++++++-------- 1992/lush/README.md | 7 ++++--- 1992/marangon/README.md | 3 ++- 1992/nathan/README.md | 8 ++++---- 1992/vern/README.md | 22 +++++++++++----------- 1992/westley/README.md | 2 +- 12 files changed, 66 insertions(+), 64 deletions(-) diff --git a/1992/adrian/README.md b/1992/adrian/README.md index 99d428464..d2104fbbb 100644 --- a/1992/adrian/README.md +++ b/1992/adrian/README.md @@ -15,16 +15,16 @@ make all [Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) changed the location that it used `gets()` to be `fgets()` instead to make it safer and to prevent -any warnings during linking or runtime. One might think that simply changing the -gets() to fgets() (with stdin) would work but it did not because `fgets()` -stores the newline and `gets()` does not. The code was relying on not having -this newline. With `fgets()` the code `if(A(Y)) puts(Y);` ended up printing an -extra line which made the generation of some files (like `adhead.c`) fail to -compile (`gets()` does not store the newline but `fgets()` does). Why? There was -a blank line after a `\` at the end of the first line of a macro definition! -Thus the code now first trims off the last character of the buffer read to get -the same correct functionality but in a safe way. Thank you Cody for your -assistance! +annoying warnings during compiling, linking or runtime (interspersed with the +program's output). One might think that simply changing the gets() to fgets() +(with stdin) would work but it did not because `fgets()` stores the newline and +`gets()` does not. The code was relying on not having this newline. With +`fgets()` the code `if(A(Y)) puts(Y);` ended up printing an extra line which +made the generation of some files (like `adhead.c`) fail to compile (`gets()` +does not store the newline but `fgets()` does). Why? There was a blank line +after a `\` at the end of the first line of a macro definition! Thus the code +now first trims off the last character of the buffer read to get the same +correct functionality but in a safe way. Thank you Cody for your assistance! ## Try: diff --git a/1992/albert/README.md b/1992/albert/README.md index af8202625..d16ebdeae 100644 --- a/1992/albert/README.md +++ b/1992/albert/README.md @@ -47,8 +47,8 @@ Both albert and albert.orig loop without printing anything, although the first factor is 101 and is usually found in an instant. ``` -The `albert.c` file is the fixed file, whereas the `albert.alt.c` -is the file before applying Leo Broukhis' fix. +The [albert.c](albert.c) file is the fixed file, whereas the +[albert.alt.c](albert.alt.c) is the file before applying Leo Broukhis' fix. To compile this alternate version: @@ -119,7 +119,7 @@ destroy some of the lay out. Running the program through lint shows the usual remarks for a K&R program. Defeating this through casts does not make a program cleaner in my opinion. -### Hints: +### Hints Here are some hints, but they may not be too helpful: diff --git a/1992/buzzard.1/README.md b/1992/buzzard.1/README.md index 403c3cc52..36379d272 100644 --- a/1992/buzzard.1/README.md +++ b/1992/buzzard.1/README.md @@ -13,7 +13,7 @@ USA make all ``` -## To run +## To run: ```sh ./buzzard.1 num num @@ -52,13 +52,13 @@ What you shouldn't think about `buzzard.1`: I didn't just submit the post-C-preprocessed output as an entry. -#### Cute trick warning: +#### Cute trick warning `buzzard.1` contains only a numeric printf, yet sometimes it prints out short strings. -### What it does: +### What it does `buzzard.1` is a simple mathematical program. It expects two numeric arguments. @@ -86,7 +86,7 @@ If the first argument is less than 0, it prints out an error message. -### What it is: +### What it is `buzzard.1` is a translator from a pseudo-assembly language into a subset of C suitable for execution on Charles Babbage's Analytical Engine. Or rather, the @@ -100,22 +100,22 @@ could have been simulated on the AE by connecting the already-processed card stack to the input card stack. -### How to try to understand it: +### How to try to understand it *Don't* expand the `#define`s! Rather, decipher what they do. Some of them are mere obfuscation fodder, put in to encourage you to run it through CPP. -### What it doesn't quite do right as an emulator: +### What it doesn't quite do right as an emulator Because of the definitional constraints, calls to `atoi(argv[#])` also appear -inside the loop. These could be put outside-- the initial values of the +inside the loop. These could be put outside--the initial values of the "registers" on the AE--but the macro conventions being used didn't lend themselves to it. -### Theoretical observations: +### Theoretical observations The simulated comparison operations only work with a certain range of numbers; numbers that are too large will cause the output code to fail to simulate the @@ -130,7 +130,7 @@ simulate any existing machine--although not quickly). This would be a good place to site some references on the AE, but I don't have any. -### Definition of the input language to buzzard.1 (OR What Exactly Do All The Macros Do?): +### Definition of the input language to buzzard.1 (OR What Exactly Do All The Macros Do?) [Don't read this unless you're stumped!] diff --git a/1992/buzzard.2/README.md b/1992/buzzard.2/README.md index 9bc4b0e60..d9ae23b46 100644 --- a/1992/buzzard.2/README.md +++ b/1992/buzzard.2/README.md @@ -67,7 +67,7 @@ Have fun! ## Author's remarks: -### What it does: +### What it does `first` implements a relatively primitive stack machine. How primitive? It supplies 13 visible primitives: 3 arithmetic, @@ -88,7 +88,7 @@ are below, and the interesting property is discussed much further down. -### How to run it: +### How to run it `first` expects you to first enter the names of the 13 primitives, separated by whitespace--it doesn't care what you name them, but @@ -129,7 +129,7 @@ reimplementing all of first and third a second time--I did not care to tackle this project. -### Compiling: +### Compiling `first` is reasonably portable. You may need to adjust the size of the buffers on smaller machines; `m[]` needs to be at least 2000 long, though. diff --git a/1992/gson/README.md b/1992/gson/README.md index e6c06783d..36d05923d 100644 --- a/1992/gson/README.md +++ b/1992/gson/README.md @@ -40,10 +40,10 @@ Determine where your system dictionary is located. You may find it located in one of the following places: ``` - /usr/share/dict/words - /usr/share/lib/spell/words - /usr/ucblib/dict/words - /dev/null # <-- for machines with nothing to say +/usr/share/dict/words +/usr/share/lib/spell/words +/usr/ucblib/dict/words +/dev/null # <-- for machines with nothing to say ``` Then using the proper dictionary: @@ -83,13 +83,13 @@ construed to mean Alphabet Game, and by pure coincidence it happens to be the author's initials. -### What it does: +### What it does AG takes one or more words as arguments, and tries to find anagrams of those words, i.e. words or sentences containing exactly the same letters. -### How to use it: +### How to use it To run AG, you need a dictionary file consisting of distinct words in the natural language of your choice, one word on each line. If your machine doesn't @@ -113,7 +113,7 @@ number of words in the anagrams is limited to 3 by default. This limit can be changed using a numeric command line option, as in `./ag -4 international obfuscated c code contest