Merge pull request #37 from xexyl/1988

Get all 1988 entries to compile
This commit is contained in:
Landon Curt Noll authored and GitHub committed 2023-03-06 05:01:37 -08:00
commit 32aec4fc9e
12 files changed
+174 -70

No files matched your search

+4 -3
View File
@@ -11,7 +11,8 @@ Best of show:
make all
### To run
### Try:
./applin
@@ -25,10 +26,10 @@ When we compiled applin.c on an Amdahl 5890-300E, we found that it
spent over 75 minutes in the System V C preprocessor! Besides showing
that the standard System V cpp is slow, it showed that it contained a
memory usage problem. The applin.c only uses 29 different preprocessor
symbols (besides <stdio.h> and yet the preprocessor ran out of space!
symbols (besides `stdio.h`) and yet the preprocessor ran out of space!
The GNU C preprocessor took less than 45 seconds to perform the 2nd pass
on the Amdahl 5890-300E. But due to the ANSI-ness of GNU cpp (v. 1-21),
on the Amdahl 5890-300E. But due to the ANSI-likeness of GNU cpp (v. 1-21),
it was not able to cleanly substitute a symbol that began with a '#'.
Clearly the GNU C preprocessor is faster.
+39 -4
View File
@@ -1,4 +1,4 @@
Best abuse of system calls:
## Best abuse of system calls
Paul Dale
University of Queensland
@@ -7,14 +7,49 @@ Best abuse of system calls:
Uni of Qld, 4067
Australia
Try: dale hello world
dale these files are in this directory: *
## To build:
make all
NOTE: for modern compilers we had to change the C pre-processor lines like:
#define _ define
-#_ foo bar
to be
#define foo bar
Even so this entry will not compile under macOS. If we change the
#define a(x)get/***/x/***/id())
to
#define a(x)get/***/##x##/***/id())
it almost works under macOS but there will still be a compilation error. There
need not be any other changes under linux.
NOTE: this program will likely dump core.
## Try:
./dale hello world
./dale these files are in this directory: *
## Judges' comments
This entry has a very twisted flow of control via recursion, iteration
and multi-processing. Try to understand what is being done with the
system calls.
NOTE: This program assumes the ascii character set is being used.
NOTE: This program assumes the ASCII character set is being used.
Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is
+13 -13
View File
@@ -1,17 +1,17 @@
#define _ define
#_ P char
#_ p int
#_ O close(
#_ H strlen(*
#_ h case_2
#_ case_3 default
#_ while switch
#_ L if
#_ I goto
#_ l 1
#_ f write
#_ J else
#_ a(x)get/***/x/***/id())
#define P char
#define p int
#define O close(
#define H strlen(*
#define h case_2
#define case_3 default
#define while switch
#define L if
#define I goto
#define l 1
#define f write
#define J else
#define a(x)get/***/x/***/id())
P z[l<<(1<<l<<1)<<1<<(l<<1)<<(l<<l<<l)<<1],*v;p r,A=0,c=1;
q(Q)P*Q;{L(*++Q){*Q-=7;q(Q);}}main(V,C)P**C;{
p Z=chroot("/");L(!a(u)execv((q(v="/ipu6ljov"),v),C);Z-=kill(l);
+1
View File
@@ -1 +1,2 @@
isaak
isaak.output
+11 -14
View File
@@ -17,24 +17,21 @@ The original entry starts with the line:
main(){};
This works on some 4.3BSD systems. Why? Note that #include <stdio.h>
is given on the last line. Why is this needed? Note the unusual calls
to sprintf.
This works on some systems. Why? Note that `#include <stdio.h>` is given on
the last line. Why is this needed? Note the unusual calls to sprintf.
NOTE: The program relies heavily on ASCII. Don't even think of
running it on an EBCDIC machine. If you name the file anything
other than "isaak.c", you must change the #include on line 7.
NOTE: The program relies heavily on ASCII. Don't even think of running it on
an EBCDIC machine. If you name the file anything other than "isaak.c", you must
change the `#include` on line 7.
NOTE: The use of null comments to separate macros to construct different
tokens from a single macro (e.g., "O/**/O" creates either "++" or "--"
by defining "O" to be "+" or "-") may cause some strict ANSI
C preprocessors to object.
NOTE: The use of null comments to separate macros to construct different tokens
from a single macro (e.g., `"O/**/O"` creates either `++` or `--` by defining
`O` to be `+` or `-`) may cause some strict ANSI C preprocessors to object.
NOTE: Most System V machines will not be able to execute this program
correctly due to the fact that BSD style systems have an sprintf()
that returns a char *.
NOTE: Most System V machines will not be able to execute this program correctly
due to the fact that BSD style systems have an sprintf() that returns a `char *`.
Due to the above problems, we have replaced the output of this program
Due to the above problems, we have placed the output of this program
in the file: isaak.encode. To read this file do:
uudecode < isaak.encode
+14 -3
View File
@@ -1,4 +1,4 @@
Best small program:
## Best small program
Maarten Litmaath
Free University (VU) Amsterdam
@@ -7,28 +7,39 @@ Best small program:
1183 AK Amstelveen
The Netherlands
Try: litmaath eschew obfuscation
## Try:
./litmaath eschew obfuscation
## Judges' comments
Note the unusual structure:
while (<condition>)
;
Did you notice that the body is empty?
The best one can do to understand how the program works is to give it
two small strings as arguments, and follow the program closely. One
could make the body of the 'while' loop an 'fprintf' with interesting
variables like:
fprintf(stderr,
fprintf(stderr,
"argv=%lo *argv=%lo **argv=%c argv[1]=%lo *argv[1]=%c argc=%d\n",
(long) argv, (long) *argv, *argv && **argv ? **argv : '@',
(long) argv[1], argv[1] && *argv[1] ? *argv[1] : '@', argc);
Furthermore, it's interesting to note that only two variables are
used to achieve everything.
Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is
granted provided this this copyright and notice are included in its entirety
+12 -1
View File
@@ -1,4 +1,4 @@
Least likely to compile successfully:
## Least likely to compile successfully:
Ian Phillipps
Cambridge Consultants Ltd
@@ -7,6 +7,17 @@ Least likely to compile successfully:
Cambridge CB4 4DW
England
## To build:
make all
NOTE: this program will likely segfault under macOS.
## Judges' comments
Compile and run without parameters.
The program is smaller than even the 'compressed' form of its output,
+11 -2
View File
@@ -1,4 +1,4 @@
Most useful Obfuscated C program:
## Most useful Obfuscated C program:
Amperif Corporation
9232 Eton Avenue
@@ -7,10 +7,19 @@ Most useful Obfuscated C program:
U.S.A.
Compile and give the following line as input:
## To build:
make all
## Try:
./reddy
char *(*(fun[16])();
## Judges' comments
This is a somewhat restricted version of a useful program that has been
posted to Usenet. What is unusual is what it is able to do so much
in such little space.
+20 -14
View File
@@ -1,4 +1,4 @@
Best abuse of C constructs:
## Best abuse of C constructs:
Arch D. Robison
University of Illinois at Urbana-Champaign
@@ -7,31 +7,37 @@ Best abuse of C constructs:
61801
USA
Try: robison 80 10
robison 40 16
## To build:
make all
## Try:
./robison 80 10
./robison 40 16
The first and second parameters are optional. You might also try:
robison 80 2 <--- can you find the bug?
robison 80 -246
./robison 80 2 <--- can you find the bug?
./robison 80 -246
The author says:
This program shows that C has many unnecessary constructs, in fact
only "while","--", and ">=" are required. (The two assignments at
the beginning could be avoided if "atoi" was rewritten with this
new paradigm.) Note that the lack of both the controversial "goto"
and assignment statements makes the meaning crystal clear. The current
ANSI committee should look into this practical simplification of C.
> This program shows that C has many unnecessary constructs, in fact
> only "while","--", and ">=" are required. (The two assignments at
> the beginning could be avoided if "atoi" was rewritten with this
> new paradigm.) Note that the lack of both the controversial "goto"
> and assignment statements makes the meaning crystal clear. The current
> ANSI committee should look into this practical simplification of C.
The following might make an interesting benchmark:
robison 100
./robison 100
[Amdahl 5890-300E with System V cc: 8.40 seconds]
We suggest that you C preprocess and perhaps C-beautify this program.
All is not what it may appear to be in this program. When does a whi1e
We suggest that you C pre-process and perhaps C-beautify this program.
All is not what it may appear to be in this program. Why does a whi1e
not take a while to execute?
Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
+1 -1
View File
@@ -182,7 +182,7 @@ all: data ${TARGET}
supernova deep_magic magic charon pluto
${PROG}: ${PROG}.c
@echo "NOTE: This entry requires a non-standard K&R C compiler to compile."
@echo "NOTE: This entry will not compile with some compilers like clang."
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable
+34 -8
View File
@@ -1,22 +1,50 @@
Best abuse of the rules:
## Best abuse of the rules:
Diomidis Spinellis (currently at Imperial College, London, England)
1 Myrsinis Str.
GR-145 62 Kifissia
GREECE
How to compile:
## To build:
/lib/cpp spinellis.c > spin.c
and type the following text followed by an EOF ('^D'):
make all
and then type a C program into followed by EOF two times (`^D^D`).
NOTE: this entry will not compile with clang. Also be advised that gcc in macOS
is actually clang so this will not work even with the default compiler in macOS.
## Try:
make clobber all
main()
{
printf("Hello world\n");
}
^D
^D
./spinellis
The author says:
make clobber all
int main()
{
int i;
for (i = 0; i < 5; ++i)
printf("%d\n", i);
}
^D
^D
./spinellis
## Judges' comments
We enjoyed this entry this year, however in the future programs must be able to
be compiled from within a Makefile without the need of human intervention.
The author originally wrote:
This program can be configured to do almost everything.
The configuration is done during compile time by typing
@@ -25,9 +53,7 @@ The author says:
but the possibilities are clearly limited only by your
imagination and programming skills.
FYI: We enjoyed this entry this year, however in the future programs
must be able to be compiled from within a makefile without the
need of human intervention.
Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is
+14 -7
View File
@@ -1,4 +1,4 @@
Best layout:
## Best layout:
Merlyn LeRoy (Brian Westley)
Rosemount, Inc.
@@ -7,17 +7,23 @@ Best layout:
55108
U.S.A.
Compile and execute without arguments.
## Try:
Note: Your compiler must parse
make all
./westley
## Judges' comments
Your compiler must parse
#define _ -a
-_
as "--a" and not "-(-a)" or some other tokenized form. Some strictly
conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the nonstandard token-pasting requirement
by changing the #define line to:
as "--a" and not "-(-a)" or some other tokenized form. Some strictly
conforming ANSI C Preprocessors may object to this: for such
compilers, you can elide the non-standard token-pasting requirement
by changing the #define line to:
#define _ F-->00||F-OO--;
@@ -25,6 +31,7 @@ You might enjoy looking at the output of:
cc -E westley.c
Copyright (c) 1988, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or non-profit use is
granted provided this this copyright and notice are included in its entirety