Update 1992 winning entries' README.md files

Format and typo fixes.
This commit is contained in:
Cody Boone Ferguson committed 2023-04-14 06:24:32 -07:00
1 parent 7342be70a5
commit cf4437c508
12 files changed
+66 -64

No files matched your search

+10 -10
View File
@@ -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:
+3 -3
View File
@@ -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:
+9 -9
View File
@@ -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!]
+3 -3
View File
@@ -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.
+8 -8
View File
@@ -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 </usr/dict/words`.
### Bugs:
### Bugs
- There is no error checking.
- Standard input must be seekable, so you can't pipe the dictionary into AG.
@@ -126,7 +126,7 @@ it can solve is severely limited on machines that limit the stack size to 64k or
less.
### Obfuscatory notes:
### Obfuscatory notes
As you can see, AG takes advantage of the new '92 whitespace rules to
achieve a clear, readable, self-documenting layout. The identifiers
+3 -3
View File
@@ -37,7 +37,7 @@ modified to avoid this problem.
## Author's remarks:
### Portability:
### Portability
This program depends upon the ASCII character set, and makes certain
assumptions about the architecture. It naughtily declares the first
@@ -117,7 +117,7 @@ appears before `t`, specifying an option without numbers has no effect.
(specifying `-s -t` has the effect of producing text with the default
raster size; not a good idea!).
### Options:
### Options
The options of this program are:
@@ -155,7 +155,7 @@ bits (e.g. 8).
While the program is creating your picture, it displays dots on the
standard error to indicate its progress (one dot per pixel line).
### Example pictures to try:
### Example pictures to try
Here are a couple of good pictures to draw:
+8 -8
View File
@@ -62,9 +62,9 @@ directory, assumed that exit returned a value which cause problems for some
systems where exit returns void. The file [kivinen.c](kivinen.c) avoids this problem.
## Selected notes from the author:
## Author's remarks:
### X Entertainment Kit:
### X Entertainment Kit
This kit includes three games from the early of video games for
The X Window System Version 11 Release 5. It should work with
@@ -79,7 +79,7 @@ of aliens touches the ground, or destroy you. To win the game you
must destroy all the aliens. If you evade out from the screen you
lose.
##### Controls:
##### Controls
- Button 1 = Move left
- Button 2 = Fire missile
@@ -91,7 +91,7 @@ lose.
Break all the bricks with the ball, using your paddle. If you miss
the ball the game ends.
##### Controls:
##### Controls
- Button 1 = Move left
- Button 3 = Move right
@@ -102,14 +102,14 @@ the ball the game ends.
Catch all the falling pieces, before they reach the ground. If you
miss it, game ends. To win you must catch all 30 pieces.
##### Controls:
##### Controls
- Button 1 = Move left
- Button 3 = Move right
### Starting a game:
### Starting a game
The type of the game is determined by the number of arguments
given to the program.
@@ -126,13 +126,13 @@ given to the program.
...and so on...
### Scores:
### Scores
The exit value of the game is your score. The smaller the score
the better it is. The exit value of zero means you have won.
### Features:
### Features
The game has a cheat system, which can be found after examining the
event loop at the end of program. It is not a bug, it's a feature!
+4 -3
View File
@@ -24,9 +24,10 @@ work with gcc. Due to how it works (see Judges' remarks below) this will not
work with clang. Thank you Yusuke!
[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) made it use `fgets()`
instead of `gets()` and also added the `runme.sh` script to demonstrate it
(using make was problematic). Cody notes that unfortunately this does not work
with clang due to different compiler messages. Thank you Cody!
instead of `gets()` to prevent annoying warnings getting in the way and also
added the `runme.sh` script to demonstrate it (using make was problematic). Cody
notes that unfortunately this does not work with clang due to different compiler
messages. Thank you Cody!
For the original entry see the [archive tarball](/archive/archive-1992.tar.bz2).
+2 -1
View File
@@ -30,7 +30,8 @@ NOTE: Some systems need to compile with `-ltermcap` as well as `-lcurses`.
NOTE: The original winning source `marangon.orig.c`, found in the archive
directory, assumed that exit returns a value which cause problems for some
systems where exit returns a void. The file `marangon.c` avoids this problem.
systems where exit returns a void. The file [marangon.c](marangon.c) avoids
this problem.
## Author's remarks:
+4 -4
View File
@@ -13,7 +13,7 @@ UK BS12 4SQ
make all
```
## To run
## To run:
```sh
./nathan
@@ -84,7 +84,7 @@ re-distribute a program contest winner to the network!
## Author's remarks
### PROGRAM USE:
### Program use
This program is a hello world text encryptor/decryptor. It uses an
enigma (I think) style encryption algorithm, where the encryption
@@ -100,7 +100,7 @@ before the key. (Actually encryption and decryption proper inverse
operations, so you can use decrypt to scramble and encrypt to
descramble, if you're perverse.)
### PORTABILITY (A little knowledge is a dangerous thing):
### Portability (A little knowledge is a dangerous thing)
It's written in ANSI C, and doesn't even assume an ASCII character
set, (it has an array of the characters to convert), so should be
@@ -116,7 +116,7 @@ another scoping level does not need to be opened.
Being an encryptor/decryptor, you probably want the source code to
be obfuscated, to hide the algorithm.
### OBFUSCATION:
### Obfuscation
In spite of the fact that it looks like a nice friendly hello world
program, it isn't (as documented above). (Short lines have been padded,
+11 -11
View File
@@ -110,7 +110,7 @@ blunders but also immediately stupid moves altogether. A ply of 4
will find all mate-in-two's.
### Obfuscation:
### Obfuscation
This program is obfuscated in a number of ways. First, it abuses the
contest rule regarding ';', '{', and '}' in the source not counting
@@ -141,16 +141,16 @@ square on the board. Those moves that are legal it then explores to
see their effects (using alpha-beta search). This tactic somewhat
obfuscates the algorithm used by the program.
Finally, there are three key constants that occur throughout the
program: 64, 8, and 3 (lg 8). Rather than making these available at
compile-time, which provides a hint as to what the program is up to,
they are computed probabilistically at run-time. An instance of the
"Inspection Paradox" is used which happens to produce a value that on
average is close to .64. 10000 instances of this value are computed,
added up, and then divided by 100. Sometimes the value produced will
be 63 or 65 instead of 64 (but I've never observed any other values),
so the result is then rounded to the nearest multiple of 4, and then
the other constants are derived from it.
Finally, there are three key constants that occur throughout the program: 64,
8, and 3 (lg 8). Rather than making these available at compile-time, which
provides a hint as to what the program is up to, they are computed
probabilistically at run-time. An instance of the ["Inspection
Paradox"](https://en.wikipedia.org/wiki/Renewal_theory#Inspection_paradox) is
used which happens to produce a value that on average is close to .64. 10000
instances of this value are computed, added up, and then divided by 100.
Sometimes the value produced will be 63 or 65 instead of 64 (but I've never
observed any other values), so the result is then rounded to the nearest
multiple of 4, and then the other constants are derived from it.
## Copyright and CC BY-SA 4.0 License:
+1 -1
View File
@@ -21,7 +21,7 @@ not segfault if not enough args were specified. He did the same for the
alternative version (see below) provided by the author (the original can be seen
in the author's remarks below). Thank you Cody for your assistance!
## To run
## To run:
If lost: