1996 fixes and updates
Update the README.md files - at least with those not in a previous commit. The updates mostly include formatting (make them markdown) but probably also typos here and there. More probably has to be done with these files. The 1996/august/.gitignore was updated as well with a file that is generated by one of the suggested commands.
This commit is contained in:
1 parent
2d6d05e053
commit
8870040156
9 files changed
+82
-63
No files matched your search
@@ -1,2 +1,3 @@
|
|||||||
august
|
august
|
||||||
august.oc
|
august.oc
|
||||||
|
test.oo
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
## To run:
|
||||||
|
|
||||||
cat august.c test.oc | ./august > test.oo
|
cat august.c test.oc | ./august > test.oo
|
||||||
./august < test.oo
|
./august < test.oo
|
||||||
@@ -19,19 +19,19 @@
|
|||||||
If the above cat line does not execute in a very short amount
|
If the above cat line does not execute in a very short amount
|
||||||
of time, then you may need to fix your compiler or use gcc.
|
of time, then you may need to fix your compiler or use gcc.
|
||||||
|
|
||||||
## Judges' comments
|
## Try:
|
||||||
|
|
||||||
Try:
|
|
||||||
cat august.c fac.oc | ./august > fac.oo
|
cat august.c fac.oc | ./august > fac.oo
|
||||||
./august < fac.oo
|
./august < fac.oo
|
||||||
|
|
||||||
Or try:
|
|
||||||
cat august.c fac.oc | ./august | ./august
|
cat august.c fac.oc | ./august | ./august
|
||||||
|
|
||||||
And try:
|
|
||||||
cat august.c parse.oc | ./august > parse.oo
|
cat august.c parse.oc | ./august > parse.oo
|
||||||
cat parse.oo fac.oc | ./august | ./august
|
cat parse.oo fac.oc | ./august | ./august
|
||||||
|
|
||||||
|
|
||||||
|
## Judges' comments:
|
||||||
|
|
||||||
This entry can feed on itself. If you C preprocess the source,
|
This entry can feed on itself. If you C preprocess the source,
|
||||||
you compile the interpreter:
|
you compile the interpreter:
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
of operators, and control constructs.
|
of operators, and control constructs.
|
||||||
|
|
||||||
The compiler has absolutely no error checking, so things
|
The compiler has absolutely no error checking, so things
|
||||||
can go wrong. But this is what seasoned C progammers are used to.
|
can go wrong. But this is what seasoned C programmers are used to.
|
||||||
|
|
||||||
Assume that the interpreter has been compiled (source in prog.c and
|
Assume that the interpreter has been compiled (source in prog.c and
|
||||||
binary in prog) and that we have this in a file named test.oc:
|
binary in prog) and that we have this in a file named test.oc:
|
||||||
@@ -170,6 +170,7 @@
|
|||||||
|
|
||||||
OC grammar
|
OC grammar
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Terminals are in quotes, () is used for bracketing.
|
Terminals are in quotes, () is used for bracketing.
|
||||||
|
|
||||||
program: decl*
|
program: decl*
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ We (the judges) recommend that you take the time needed to understand
|
|||||||
how this program works. The source is small enough to make the effort
|
how this program works. The source is small enough to make the effort
|
||||||
reasonable, and complex enough to make it interesting.
|
reasonable, and complex enough to make it interesting.
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments:
|
||||||
|
|
||||||
This program assumes that your terminal wraps lines automatically.
|
This program assumes that your terminal wraps lines automatically.
|
||||||
If this is not the case, you may need to change the space in the
|
If this is not the case, you may need to change the space in the
|
||||||
|
|||||||
@@ -14,6 +14,10 @@
|
|||||||
|
|
||||||
./eldby
|
./eldby
|
||||||
|
|
||||||
|
WARNING: on modern systems this is very fast and could be a problem for those
|
||||||
|
susceptible to photosensitivity. Please try this one with caution if this
|
||||||
|
applies to you! The same goes for people who can be overstimulated.
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments
|
||||||
|
|
||||||
We were impressed by the author's ability to render spheres in 3D
|
We were impressed by the author's ability to render spheres in 3D
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
|
|
||||||
echo 'Huffman Decoding' | ./huffman
|
echo 'Huffman Decoding' | ./huffman
|
||||||
|
|
||||||
|
NOTE: this program uses `gets()` so you will likely get a warning when compiling
|
||||||
|
and/or running on modern systems.
|
||||||
|
|
||||||
## Try:
|
## Try:
|
||||||
|
|
||||||
echo 'seeing or feeling is believing' | ./huffman
|
echo 'seeing or feeling is believing' | ./huffman
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
### To run:
|
||||||
|
|
||||||
./jonth
|
./jonth
|
||||||
|
|
||||||
@@ -20,18 +20,18 @@
|
|||||||
|
|
||||||
./jonth host1:0 host2:0
|
./jonth host1:0 host2:0
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments:
|
||||||
|
|
||||||
|
|
||||||
For extra credit, figure out how you can cheat by taking over
|
For extra credit, figure out how you can cheat by taking over
|
||||||
a square already occupied by an opponent.
|
a square already occupied by an opponent.
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments:
|
||||||
|
|
||||||
This is multi-user tic-tac-toe for X Windows. You may give one or two X
|
This is multi-user tic-tac-toe for X Windows. You may give one or two X
|
||||||
displays as arguments to this game.
|
displays as arguments to this game.
|
||||||
|
|
||||||
Known bugs:
|
### Known bugs:
|
||||||
|
|
||||||
Sometimes on Solaris X gets confused and this program core dumps,
|
Sometimes on Solaris X gets confused and this program core dumps,
|
||||||
solution: give two display arguments (prog host:0 host:0)
|
solution: give two display arguments (prog host:0 host:0)
|
||||||
|
|||||||
+8
-8
@@ -20,13 +20,13 @@ For more information try:
|
|||||||
./rcm < rfc1952.gz
|
./rcm < rfc1952.gz
|
||||||
|
|
||||||
|
|
||||||
## Judges' comments
|
## Judges' comments:
|
||||||
|
|
||||||
For a good noop try:
|
For a good noop try:
|
||||||
|
|
||||||
gzip -c < rcm.c | ./rcm
|
gzip -c < rcm.c | ./rcm
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments:
|
||||||
|
|
||||||
Except for some silly requirements regarding input validation, CRC
|
Except for some silly requirements regarding input validation, CRC
|
||||||
checking, and similar unimportant fluff, this program is a fully
|
checking, and similar unimportant fluff, this program is a fully
|
||||||
@@ -34,20 +34,20 @@ For a good noop try:
|
|||||||
"gzip" compressed file on standard input, and it will write the fully
|
"gzip" compressed file on standard input, and it will write the fully
|
||||||
uncompressed original file to standard output.
|
uncompressed original file to standard output.
|
||||||
|
|
||||||
ObJustifications for this entry:
|
### ObJustifications for this entry:
|
||||||
|
|
||||||
The Design Trade-off Argument
|
#### The Design Trade-off Argument:
|
||||||
|
|
||||||
"The 184 characters worth of defines in the build file have been
|
"The 184 characters worth of defines in the build file have been
|
||||||
carefully offset by 184 redundant and unecessary '{', '}', and ';'
|
carefully offset by 184 redundant and unnecessary '{', '}', and ';'
|
||||||
characters in the source file."
|
characters in the source file."
|
||||||
|
|
||||||
The Design Review Argument
|
#### The Design Review Argument:
|
||||||
|
|
||||||
"Using only 216 characters out of a maximum of 256, the build file
|
"Using only 216 characters out of a maximum of 256, the build file
|
||||||
meets and actually exceeds specification."
|
meets and actually exceeds specification."
|
||||||
|
|
||||||
The Program Metrics Argument
|
#### The Program Metrics Argument:
|
||||||
|
|
||||||
"The program source is less than 3,100 characters in length and
|
"The program source is less than 3,100 characters in length and
|
||||||
uncompresses file `emacs-19.34b.tar.gz' in about 130 seconds on
|
uncompresses file `emacs-19.34b.tar.gz' in about 130 seconds on
|
||||||
@@ -61,7 +61,7 @@ For a good noop try:
|
|||||||
which represents a better than 530% improvement in the ratio of
|
which represents a better than 530% improvement in the ratio of
|
||||||
source file size to execution time."
|
source file size to execution time."
|
||||||
|
|
||||||
The Whining Programmer's Argument
|
#### The Whining Programmer's Argument:
|
||||||
|
|
||||||
"The inflate algorithm requires that over 400 characters worth
|
"The inflate algorithm requires that over 400 characters worth
|
||||||
of constants and tables be defined. Which means the program
|
of constants and tables be defined. Which means the program
|
||||||
|
|||||||
+33
-21
@@ -12,39 +12,45 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
## To run:
|
||||||
|
|
||||||
./schweikh2
|
./schweikh2
|
||||||
|
|
||||||
## Judges' comments
|
The program accepts up to 4 parameters:
|
||||||
|
|
||||||
Also try:
|
0. The number of operators in the expression [default: 9]
|
||||||
|
|
||||||
|
1. The value of the first operand [default: 1]
|
||||||
|
|
||||||
|
2. The (possibly negative) increment to the next operand [default: 1]
|
||||||
|
|
||||||
|
3. The goal value or 0/0 [default: 42]
|
||||||
|
|
||||||
|
|
||||||
|
## Try:
|
||||||
|
|
||||||
./schweikh2 15 1 0 0/0
|
./schweikh2 15 1 0 0/0
|
||||||
|
|
||||||
The program accepts up to 4 parameters:
|
What happens if you pass only three parameters like the below?
|
||||||
|
|
||||||
1) The number of operators in the expression [default: 9]
|
./schweikh2 15 1 0
|
||||||
|
|
||||||
2) The value of the first operand [default: 1]
|
## Judges' comments:
|
||||||
|
|
||||||
3) The (possibly negative) increment to the next operand [default: 1]
|
|
||||||
|
|
||||||
4) The goal value or 0/0 [default: 42]
|
|
||||||
|
|
||||||
The original program, with only slight obfuscations, may be found
|
The original program, with only slight obfuscations, may be found
|
||||||
in hunni.c. The perl script, obfuscates it appropriately:
|
in `hunni.c`. The perl script, obfuscates it appropriately:
|
||||||
|
|
||||||
perl ./hunni.pl < hunni.c
|
perl ./hunni.pl < hunni.c
|
||||||
|
|
||||||
This entry was another crowd pleaser at the IOCCC BOF.
|
This entry was another crowd pleaser at the IOCCC BOF.
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments:
|
||||||
|
|
||||||
Note: the source must be viewed with tabstop 8. To appreciate the
|
Note: the source must be viewed with tabstop 8. To appreciate the
|
||||||
beauty have your eyes half closed.
|
beauty have your eyes half closed.
|
||||||
|
|
||||||
Why I think this program is obfuscated:
|
### Why I think this program is obfuscated:
|
||||||
|
|
||||||
C is a free format language. It is therefore a question of style how
|
C is a free format language. It is therefore a question of style how
|
||||||
variables, operators, declarations, functions and syntactic elements
|
variables, operators, declarations, functions and syntactic elements
|
||||||
@@ -57,7 +63,7 @@
|
|||||||
longer than one character have gone. They have been replaced by macro
|
longer than one character have gone. They have been replaced by macro
|
||||||
calls with quite a number of arguments. The keys are the token pasting
|
calls with quite a number of arguments. The keys are the token pasting
|
||||||
and stringizing macros e and O. The "arcane rules of token pasting"
|
and stringizing macros e and O. The "arcane rules of token pasting"
|
||||||
[K&R2] are used up to three levels, H(O,r)R(O,r)! which is needed to make
|
[K&R2] are used up to three levels, `H(O,r)R(O,r)` (!) which is needed to make
|
||||||
one 8-character token from 8 characters ('unsigned'). BTW, C has no 9 or
|
one 8-character token from 8 characters ('unsigned'). BTW, C has no 9 or
|
||||||
more character reserved words, so a fourth level is only required if
|
more character reserved words, so a fourth level is only required if
|
||||||
you intend to generate object names from 9 or more components. The final
|
you intend to generate object names from 9 or more components. The final
|
||||||
@@ -78,10 +84,11 @@
|
|||||||
lint). The last assignment is J = printf ("%c", 10); so the exit
|
lint). The last assignment is J = printf ("%c", 10); so the exit
|
||||||
status is 0 unless the last printf failed, which is even a *useful*
|
status is 0 unless the last printf failed, which is even a *useful*
|
||||||
status. A further obfuscation is the use of 10 instead of '\n'.
|
status. A further obfuscation is the use of 10 instead of '\n'.
|
||||||
'\n' can not be constructed by token pasting, AFAIK. That's why schweikh2
|
'\n' can not be constructed by token pasting, AFAIK. That's why `schweikh2`
|
||||||
is likely to produce occasional garbage on non-ASCII execution character
|
is likely to produce occasional garbage on non-ASCII execution character
|
||||||
set systems.
|
set systems.
|
||||||
|
|
||||||
|
|
||||||
What this program does:
|
What this program does:
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
@@ -115,16 +122,21 @@
|
|||||||
|
|
||||||
Sample arguments:
|
Sample arguments:
|
||||||
-----------------
|
-----------------
|
||||||
$ schweikh2 6
|
|
||||||
$ schweikh2 7 0
|
$ ./schweikh2 6
|
||||||
$ schweikh2 7 7 0
|
$ ./schweikh2 7 0
|
||||||
$ schweikh2 8 9 -1 -67/21
|
$ ./schweikh2 7 7 0
|
||||||
$ schweikh2 8 2 2/5 -98/25
|
$ ./schweikh2 8 9 -1 -67/21
|
||||||
$ schweikh2 2 1/0 1 1/0
|
$ ./schweikh2 8 2 2/5 -98/25
|
||||||
|
$ ./schweikh2 2 1/0 1 1/0
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
The diamond pattern can be continued without a break.
|
The diamond pattern can be continued without a break.
|
||||||
For a nice printout try this on your Bourne compatible shell
|
For a nice printout try this on your Bourne compatible shell:
|
||||||
|
|
||||||
|
|
||||||
% while :; do grep -v '#' schweikh2.c; done
|
% while :; do grep -v '#' schweikh2.c; done
|
||||||
|
|
||||||
|
|
||||||
+21
-23
@@ -12,21 +12,22 @@
|
|||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
### To run
|
## To run:
|
||||||
|
|
||||||
WARNING: Do not run this program without reading this text down to the end.
|
**WARNING**: Do not run this program without reading this text down to the end!
|
||||||
It may render your system unusable for a limited amount of time
|
It may render your system unusable for a limited amount of time
|
||||||
or force you to reboot using the Big Red Button! This is not a joke.
|
or force you to reboot using the Big Red Button! This is **NOT** a joke.
|
||||||
You have been warned.
|
You have been warned.
|
||||||
|
|
||||||
./schweikh3
|
./schweikh3
|
||||||
|
|
||||||
## Judges' comments
|
|
||||||
|
## Judges' comments:
|
||||||
|
|
||||||
The source fails to compile on compilers that recognize the inline
|
The source fails to compile on compilers that recognize the inline
|
||||||
keyword by default. For gcc, you may need to use -ansi.
|
keyword by default. For gcc, you may need to use -ansi.
|
||||||
|
|
||||||
See the file, schweikh3.info for example output from various systems.
|
See the file, `schweikh3.info` for example output from various systems.
|
||||||
|
|
||||||
But still it is a useful utility. To use try:
|
But still it is a useful utility. To use try:
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
-I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \
|
-I. -D_POSIX_SOURCE '-Ddifftime(a,b)=(double)(b-a)' \
|
||||||
schweikh3.c -o schweikh3
|
schweikh3.c -o schweikh3
|
||||||
|
|
||||||
## Author's comments
|
## Author's comments:
|
||||||
|
|
||||||
Why I think my entry is obfuscated
|
Why I think my entry is obfuscated
|
||||||
----------------------------------
|
----------------------------------
|
||||||
@@ -83,7 +84,7 @@
|
|||||||
prog.c: At top level:
|
prog.c: At top level:
|
||||||
prog.c:97: parse error before `void'
|
prog.c:97: parse error before `void'
|
||||||
|
|
||||||
The -ansi option to gcc fixes this.
|
The `-ansi` option to gcc fixes this.
|
||||||
|
|
||||||
The source fails to compile on obsolete systems with obsolete
|
The source fails to compile on obsolete systems with obsolete
|
||||||
memory models due to the identifier `far' (to be honest: this is
|
memory models due to the identifier `far' (to be honest: this is
|
||||||
@@ -98,15 +99,15 @@
|
|||||||
expression).
|
expression).
|
||||||
|
|
||||||
And what about sizeof __TIME__? This one's for the philosophers
|
And what about sizeof __TIME__? This one's for the philosophers
|
||||||
and physicists among us programmers. What is it? sizeof (char *) -- no.
|
and physicists among us programmers. What is it? sizeof (char *)? -- no.
|
||||||
Strlen ("hh:mm:ss")? -- no. It's the same as sizeof __DATE__ -
|
strlen ("hh:mm:ss")? -- no. It's the same as sizeof __DATE__ -
|
||||||
sizeof "no" :-)
|
sizeof "no" :-)
|
||||||
|
|
||||||
The program is POSIX conformant and lints without warning under
|
The program is POSIX conformant and lints without warning under
|
||||||
Solaris' Sunpro lint. Allocated memory is correctly freed on all
|
Solaris' Sunpro lint. Allocated memory is correctly freed on all
|
||||||
possible execution paths.
|
possible execution paths.
|
||||||
|
|
||||||
What this program does
|
What this program does:
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
This program tests your operating system's allocation honesty. It
|
This program tests your operating system's allocation honesty. It
|
||||||
@@ -119,21 +120,18 @@
|
|||||||
|
|
||||||
I distinguish three different behaviours:
|
I distinguish three different behaviours:
|
||||||
|
|
||||||
1) OS without memory overcommit:
|
1. OS without memory overcommit: malloc does not lie -- you can use all memory
|
||||||
malloc does not lie -- you can use all memory the OS granted to you.
|
the OS granted to you.
|
||||||
|
|
||||||
2) OS with memory overcommit:
|
2. OS with memory overcommit: malloc lies -- any program may get killed at
|
||||||
malloc lies -- any program may get killed at random when the
|
random when the OS can not acquire a free page.
|
||||||
OS can not acquire a free page.
|
|
||||||
|
|
||||||
3) OS with pseudo memory overcommit:
|
3. OS with pseudo memory overcommit: malloc lies -- The OS puts processes to
|
||||||
malloc lies -- The OS puts processes to sleep for which it can
|
sleep for which it can not acquire a free page. Because other processes are also
|
||||||
not acquire a free page. Because other processes are also
|
affected this way, the system slows down and quickly becomes totally unusable
|
||||||
affected this way, the system slows down and quickly becomes
|
(also known as "thrashing"). Because more and more processes wait for memory
|
||||||
totally unusable (also known as "thrashing"). Because more and
|
returned by other exiting processes the system eventually enters a deadlock
|
||||||
more processes wait for memory returned by other exiting processes
|
situation and effectively halts.
|
||||||
the system eventually enters a deadlock situation and effectively
|
|
||||||
halts.
|
|
||||||
|
|
||||||
I had the pleasure and pain to find all three behaviours on the
|
I had the pleasure and pain to find all three behaviours on the
|
||||||
platforms I use regularly. What follows are the outputs for
|
platforms I use regularly. What follows are the outputs for
|
||||||
|
|||||||
Reference in new issue
Block a user