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