Add preview of 1984-2019

The 2020 winners are hinted it, but the source code is not there,
nor are the hints. Someone could look into the HTML and
see what was commented out, but that is not a problem because
WHO won is known and the name of their AWARD is known already.
Moreover a number of the winners have talked about what their
entirs do, so the commented out spoiler text is not a bit problem.

One will find HTML commented out with:

    <!-- XXX remove when 2020 is ready
    2020 links here
    XXX remove when 2020 is ready -->

The "XXX remove when 2020 is ready" string is found at the
start and end comment blocks.  Again, soneone could read
what was commented out, but that is OK since most of that
information is known or can be known.  The following files
have such HTML comment blocks in them.

    ./winners.html
    ./years-spoiler.html
    ./years.html

In addition, ./all/summary.txt was modified to not
include the 2020 entries for the momemt.

The 2020 winner code AND write-ups are NOT part of this set.

p.s. The all/all.tar.bz2 does not contain the 2020 source code (yet?).
This commit is contained in:
Landon Curt Noll committed 2020-12-30 16:57:03 -08:00
1 parent 28efc67f5d
commit c0663537cb
1683 files changed
+220064

No files matched your search

BIN
View File
Binary file not shown.
+71
View File
@@ -0,0 +1,71 @@
10 REM Lunar Lander
20 REM By Diomidis Spinellis
30 PRINT "You aboard the Lunar Lander about to leave the spacecraft."
60 GOSUB 4000
70 GOSUB 1000
80 GOSUB 2000
90 GOSUB 3000
100 H = H - V
110 V = ((V + G) * 10 - U * 2) / 10
120 F = F - U
130 IF H > 0 THEN 80
135 H = 0
140 GOSUB 2000
150 IF V > 5 THEN 200
160 PRINT "Congratulations! This was a very good landing."
170 GOSUB 5000
180 GOTO 10
200 PRINT "You have crashed."
210 GOTO 170
1000 REM Initialise
1010 V = 70
1020 F = 500
1030 H = 1000
1040 G = 2
1050 RETURN
2000 REM Print values
2010 PRINT " Meter readings"
2015 PRINT " --------------"
2020 PRINT "Fuel (gal):"
2030 PRINT F
2040 GOSUB 2100 + 100 * (H <> 0)
2050 PRINT V
2060 PRINT "Height (m):"
2070 PRINT H
2080 RETURN
2100 PRINT "Landing velocity (m/sec):"
2110 RETURN
2200 PRINT "Velocity (m/sec):"
2210 RETURN
3000 REM User input
3005 IF F = 0 THEN 3070
3010 PRINT "How much fuel will you use?"
3020 INPUT U
3025 IF U < 0 THEN 3090
3030 IF U <= F THEN 3060
3040 PRINT "Sorry, you have not got that much fuel!"
3050 GOTO 3010
3060 RETURN
3070 U = 0
3080 RETURN
3090 PRINT "No cheating please! Fuel must be >= 0."
3100 GOTO 3010
4000 REM Detachment
4005 PRINT "Ready for detachment"
4007 PRINT "-- COUNTDOWN --"
4010 FOR I = 1 TO 11
4020 PRINT 11 - I
4025 GOSUB 4500
4030 NEXT I
4035 PRINT "You have left the spacecraft."
4037 PRINT "Try to land with velocity less than 5 m/sec."
4040 RETURN
4500 REM Delay
4510 FOR J = 1 TO 500
4520 NEXT J
4530 RETURN
5000 PRINT "Do you want to play again? (0 = no, 1 = yes)"
5010 INPUT Y
5020 IF Y = 0 THEN 5040
5030 RETURN
5040 PRINT "Have a nice day."
+73
View File
@@ -0,0 +1,73 @@
# %W% %G% %U%
#
# 1990 makefile
#
# Copyright (c) 1990, 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 and remains unaltered. All other uses must receive prior permission
# from Landon Curt Noll and Larry Bassel.
SHELL=/bin/sh
MAKE=make
MAKEFLAGS=e
# uncomment the line to select the preferred type of compile
#
# You should also check the ansi.mk or common.mk for the
# proper compiler name and flags.
#
# NOTE ==> USE=ansi compile with an ANSI compiler by default
#USE=ansi
# NOTE ==> USE=common compile with a common K&R compiler by default
#USE=common
WINNERS=cmills pjr westley stig tbr db dds theorem baruch jaw scjones
all:
-@if [ "${USE}" = "common" ]; then \
echo ${MAKE} -k -f common.mk all; \
${MAKE} -k -f common.mk all; \
elif [ "${USE}" = "ansi" ]; then \
echo ${MAKE} -k -f ansi.mk all; \
${MAKE} -k -f ansi.mk all; \
else \
echo "set USE= in Makefile to be ansi or common as desired"; \
echo "or type: make -f ansi.mk for ansi makes"; \
echo "or type: make -f common.mk for common K&R makes"; \
exit 1; \
fi
ansi:
${MAKE} -f ansi.mk all
common:
${MAKE} -f common.mk all
${WINNERS}:
-@if [ "${USE}" = "common" ]; then \
echo ${MAKE} -k -f common.mk $@; \
${MAKE} -k -f common.mk $@; \
elif [ "${USE}" = "ansi" ]; then \
echo ${MAKE} -k -f ansi.mk $@; \
${MAKE} -k -f ansi.mk $@; \
else \
echo "set USE= in Makefile to be ansi or common as desired"; \
echo "or type: make -f ansi.mk for ansi makes"; \
echo "or type: make -f common.mk for common K&R makes"; \
exit 1;\
fi
clean:
${MAKE} -f ansi.mk clean
${MAKE} -f common.mk clean
clobber:
${MAKE} -f ansi.mk clobber
${MAKE} -f common.mk clobber
nuke: clobber
${MAKE} -f ansi.mk nuke
${MAKE} -f common.mk nuke
install:
${MAKE} -f ansi.mk install
${MAKE} -f common.mk install
+33
View File
@@ -0,0 +1,33 @@
1990 marked the "The Seventh International Obfuscated C Code Contest"
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
Instructions for use: Run make to compile entries (it is possible that
on System V or non-unix systems the makefile needs to be changed). The
ansi.mk may need to be changed if your ANSI C compiler is not gcc.
Look at the source and try to figure out what the programs do, and run
them with various inputs. If you want to, look at the hints files for
(minor) spoilers.
This year, the Grand Prize won a standing ovation at USENIX.
The "Strangest abuse of the rules" award was given this year to stress
the fact that starting in 1991, entries should be shell-specific.
This year was the first year that we accepted ANSI C entries. It was
interesting to note that the ANSI C entries were as a whole less
portable than the K&R C entries. We hope that in future contests
people will enter more obfuscated and challenging ANSI C programs.
We would like to thank Barbara Frezza (loving wife of Larry Bassel) for
her role as official chef of the contest. Her opinions regarding
some of the contest entries were appreciated.
Rules and results were posted to comp.lang.c, comp.sources.unix, and
alt.sources. They have been made available on a wide number of Usenet
archive sites such as uunet.
+86
View File
@@ -0,0 +1,86 @@
# %W% %G% %U%
#
# 1990 makefile
SHELL=/bin/sh
# flags for ANSI compiles
#
# These flags are setup for gcc, change as/if needed
#
PEDANTIC=-pedantic
CFLAGS=-O -ansi
CHMOD=chmod
CC=gcc
CP=cp
RM=rm
LN=ln
# winners that may be ok to compile with ANSI
#
WINNERS=cmills pjr westley stig tbr dg baruch jaw scjones
all: ${WINNERS}
ansi: all
common:
@echo "wrong makefile, use common.mk"
exit 1
cmills: cmills.c
${CC} ${CFLAGS} -DM=500 -DN=52 -DX="srand((int)time(0L))" -DV=void \
-o cmills cmills.c
pjr: pjr.c
${CC} ${CFLAGS} pjr.c -o pjr
westley: westley.c
${CC} ${CFLAGS} westley.c -o westley
stig: stig.c stig.ksh
@echo "run the Korn shell, and source stig.ksh"
@echo "or read stig.hint and create your own aliases"
scjones: scjones.c
${CC} ${CFLAGS} scjones.c -o scjones
tbr: tbr.c
${CC} ${CFLAGS} tbr.c -o tbr
dg: dg.c
${CC} ${CFLAGS} dg.c -Dindex=strchr -o dg
# compile with the following if you don't have strchr()
#${CC} ${CFLAGS} dg.c -o dg
dds: dds.c LANDER.BAS
${CC} ${CFLAGS} dds.c -o dds
theorem: theorem.c
${CC} ${CFLAGS} theorem.c -o theorem
${RM} -f sorter.c
-./theorem -r 0 0 0 0 < theorem.c > sorter.c
${CC} ${CFLAGS} sorter.c -o sorter
${RM} -f fibonacci.c
-./sorter 0 0 0 0 < theorem.c > fibonacci.c
${CC} ${CFLAGS} fibonacci.c -o fibonacci
baruch: baruch.c
${CC} ${CFLAGS} baruch.c -o baruch
jaw: jaw.c shark.sh
${RM} -f ./zcat ./atob ./jaw
${CC} ${CFLAGS} ${PEDANTIC} jaw.c -o zcat
${LN} zcat atob
echo 'PATH=;export PATH;atob|zcat' > jaw
${CHMOD} 0555 ./jaw
clean:
${RM} -f *.o a.out core
clobber: clean
${RM} -f ${WINNERS} sorter.c sorter
${RM} -f fibonacci.c fibonacci atob zcat
nuke: clobber
@true
install: all
cat ${WINNERS} > /dev/null
+6
View File
@@ -0,0 +1,6 @@
v,i,j,k,l,s,a[99];
main()
{
for(scanf("%d",&s);*a-s;v=a[j*=v]-a[i],k=i<s,j+=(v=j<s&&(!k&&!!printf(2+"\n\n%c"-(!l<<!j)," #Q"[l^v?(l^j)&1:2])&&++l||a[i]<s&&v&&v-i+j&&v+i-j))&&!(l%=s),v||(i==j?a[i+=k]=0:++a[i])>=s*k&&++a[--i])
;
}
+74
View File
@@ -0,0 +1,74 @@
Best Small Program:
Doron Osovlanski
CADTECH - CAD/CAM Systems Ltd
24 Ben-Yosef st.
Givat-Shmuel 51905
Israel
Baruch Nissenbaum
Tel-Aviv University
The Faculty of Engineering
Tel-Aviv
Israel
Judges' comments:
Compile. Try:
echo 4 | baruch
echo 7 | baruch
This program reads an integer between 4 and 99 from the stdin.
NOTE: The original program did not have a newline at the end of
the file. We added a final newline to the file to make
unpacking easy.
Selected notes from the author:
The goal of this work was to write a program that solves the
classic n-queen problem, with a board size of up to 99x99, while
keeping the program as short as possible.
The program finds all possibilities to place N chess queens on
a NxN chess board so that no queen is in range of any other queen
(not in the same column row or diagonal). For each solution the
chess board and the place of the queens is printed to stdout.
This program is about as simple and as readable as possible.
To make things even more simple we used a very limited subset of C:
No pre-processor statements
Only one, harmless, 'for' statement
No ifs
No breaks
No cases
No functions
No gotos
No structures
In short, it contains no C language that might confuse the
innocent reader. :-)
This program demonstrates the claim that in C, any program
can be written using a single 'for' statement, as long as it is
long enough..
The authors further note:
For PC users:
In order to compile the program under Turbo-C or MSC, 'int '
should be inserted at the beginning of the program.
For better looking results it is recommended to replace the " #Q"
string with " \261\2".
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+30
View File
@@ -0,0 +1,30 @@
#include<stdio.h>
#include<time.h>
#define S(q)B(*e=0),q,p);
#define W(w)if((w)<22)v= -v;else v-=10;else
#define F for(r=d;r<d+N;
#define H(v,g)v=h(v,*g++= *r++),*g=0;
#define B(n)b(l,n),(V)printf(l
V
exit();char*g,c[M],d[N],q[N],p[N],*e,*r=d+N,l[M],*t="??",*k,*m="DEATHISDSev2oinpohae3ttsluuln4a?uibfe 5l\0rtlfrb6 ?a?el:e7$!n\0?e t8%ccp\0.%s9deelc.s T.@?-t.\t<J /\0=a\nP=Q Sex \0l KW Sin a$\0ane-lay% ge#-slediefuk ar r$via-:o ?+}:r? n \0:) ee%lone 1-esy666!-~v\n.!^`'~@#\0\np~===:=q";b(o,n)char*o;{for(k=n+m;*o++=*k;k+=9);}int
y=M*2,v,x,s,f,j,o;u(s){B(s));if(!gets(l))exit(0);return(o=
*l)=='y'||o=='Y'||o!='n'&&o!='N'&&u(s);}h(v,m){for(k=c;*k!='J';)if(m==*k++)break;m=k-c;if(v<0)W(v=m-v)
if(m==1)W(v+=11)
v+=m;return
v;}main(w,z)char**z;{b(c,2)*X;for(--w&&(y=atoi(1[z]));y>1;){if(r-d>N*3/4){B(8));F++r)*r=c[(r-d)%13];F)w=
*(g=d+rand()%N),*g=
*r,*r++=w;r=d;}for(;;){B(3),y);if(!gets(l)||(w=atoi(l))<1)exit(0);if(w&1||w>M||w>y)B(1),y<M?y:M);else
break;}y-=w,s=f=j=x=v=0,g=q,e=p;H(x,g)H(x,g)H(v,e)H(v,e)*t=
*q;S(t)*q=='A'&&y>=w/2&&u(5)&&(y+=(3*(h(0,1[q])==10)-1)*w/2);if(x==-21)goto
_;if(v==-21){y+=w/2;goto
_;}while(x>-17&&x<17)H(x,g)while((v==20||*p==-1[e])&&y>=w&&u(6)){y-=w;++s;for(g=e++;2[g]=
*g,g!=p;)--g;*g++=
*e;*g=' ';i:v=h(h(0,*p),*e++=
*r++);S(t)if(*p=='A'&&-1[e]!=
*p)goto
_;}if(f=y>=w&&u(7))y-=w,H(v,e)while(!f&&v<22&&u(4)){H(v,e)if(v<22)S(t)}_:x<0&&(x=
-x);v<0&&(v=
-v);if(v<22)if(v==x)j+=w*++f;else
if(x>21||v>x)j+=w*2*++f;if(s--){*e++=' ';*e++=
*p;*e=0;for(e=p;*e=2[e];)e++;goto
i;}y+=j;S(q)};}
+45
View File
@@ -0,0 +1,45 @@
Best Game:
Chris Mills
Wyse Technology
3471 N. 1st St.
San Jose CA 95134
USA
Judges notes:
Compile notes:
cc -DM=500 -DN=52 -DX="srand((int)time(0L))" -DV=void -o cmills cmills.c
-DM=<max bet allowed>
-DN=<52 * number of decks used>
-DX=<how to seed the rand() generator>
-DV=<void ot int>
Usage: cmills [starting_cash]
Selected notes from the author:
This is a blackjack program. It does splits, doubling down,
insurance, etc.
As best I can figure, it should be ANSI-compliant, as well as
portable to BSD & sysV (as well as the irritating compiler I
was using which assumes x=*p++ means x*=p++!). It is
reasonably robust in its error handling---it won't let you
split, double, etc. unless you actually have the cash, etc. To
terminate the program, hit EOF or type 0 or a negative number
for you wager.
The way it deals with splits is particularly cool (IMHO). You
can split many times, and it will show all hands as they are
played.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+104
View File
@@ -0,0 +1,104 @@
# %W% %G% %U%
#
# 1990 makefile
SHELL=/bin/sh
CHMOD=chmod
CC=gcc
CP=cp
RM=rm
SED=sed
LN=ln
# flags for common K&R compiles
#
CFLAGS=-O
CC=cc
# winners that may be ok to compile with common K&R
#
WINNERS=cmills pjr westley tbr dg dds theorem baruch jaw scjones
all: ${WINNERS}
ansi:
@echo "wrong makefile, use ansi.mk"
exit 1
common: all
cmills: cmills.c
${CC} ${CFLAGS} -DM=500 -DN=52 -DX="srand((int)time(0L))" -DV=int \
-o cmills cmills.c
pjr: pjr.c
${CC} ${CFLAGS} pjr.c -o pjr
westley: westley.alt.c
${CC} ${CFLAGS} westley.alt.c -o westley
westley.alt.c: westley.c
${RM} -f westley.alt.c
-${SED} -e 's/signed//' -e 's/1s/1/g' -e 's/^ #/#/' \
westley.c > westley.alt.c
stig: stig.c stig.ksh
@echo "run the Korn shell, and source stig.ksh"
@echo "or read stig.hint and create your own aliases"
tbr: tbr.c
${CC} ${CFLAGS} tbr.c -o tbr
dg: dg.c
${CC} ${CFLAGS} dg.c -Dindex=strchr -o dg
# compile with the following if you don't have strchr()
#${CC} ${CFLAGS} dg.c -o dg
dds: dds.c LANDER.BAS
${CC} ${CFLAGS} dds.c -o dds
theorem: theorem.c
${CC} ${CFLAGS} theorem.c -o theorem
${RM} -f sorter.c
-./theorem -r 0 0 0 0 < theorem.c > sorter.c
${CC} ${CFLAGS} sorter.c -o sorter
${RM} -f fibonacci.c
-./sorter 0 0 0 0 < theorem.c > fibonacci.c
${CC} ${CFLAGS} fibonacci.c -o fibonacci
baruch: baruch.c
${CC} ${CFLAGS} baruch.c -o baruch
jaw: jaw.c
${RM} -f ./zcat ./atob ./jaw
${CC} ${CFLAGS} jaw.c -o zcat
${LN} zcat atob
echo 'PATH=;export PATH;atob|zcat' > jaw
${CHMOD} 0555 ./jaw
scjones: scjones.alt.c stdlib.h
${CC} ${CFLAGS} -I. scjones.alt.c -o scjones
# NOTE: scjones.alt.c is just a de-ANSI-fied scjones.c for example only
#
scjones.alt.c: scjones.c
${RM} -f scjones.alt.c
-${SED} -e 's#??/#\\#g' -e 's/??=/#/g' -e 's/??(/[/g' -e 's/??)/]/g' \
-e "s/??'/^/g" -e 's/??</{/g' -e 's/??!/|/g' -e 's/??>/}/g' \
-e 's/??-/~/g' scjones.c > scjones.alt.c
stdlib.h:
${RM} -f stdlib.h
echo "#define EXIT_SUCCESS 0" >stdlib.h
echo "#define EXIT_FAILURE 1" >>stdlib.h
echo "void exit(); /* may need to be int on some systems */" >>stdlib.h
clean:
rm -f *.o a.out core
clobber: clean
${RM} -f ${WINNERS} sorter.c sorter westley.alt.c stdlib.h
${RM} -f fibonacci.c fibonacci atob zcat scjonds.alt.c
nuke: clobber
@true
install: all
cat ${WINNERS} > /dev/null
+24
View File
@@ -0,0 +1,24 @@
#define O(b,f,u,s,c,a)b(){int o=f();switch(*p++){X u:_ o s b();X c:_ o a b();default:p--;_ o;}}
#define t(e,d,_,C)X e:f=fopen(B+d,_);C;fclose(f)
#define U(y,z)while(p=Q(s,y))*p++=z,*p=' '
#define N for(i=0;i<11*R;i++)m[i]&&
#define I "%d %s\n",i,m[i]
#define X ;break;case
#define _ return
#define R 999
typedef char*A;int*C,E[R],L[R],M[R],P[R],l,i,j;char B[R],F[2];A m[12*R],malloc
(),p,q,x,y,z,s,d,f,fopen();A Q(s,o)A s,o;{for(x=s;*x;x++){for(y=x,z=o;*z&&*y==
*z;y++)z++;if(z>o&&!*z)_ x;}_ 0;}main(){m[11*R]="E";while(puts("Ok"),gets(B)
)switch(*B){X'R':C=E;l=1;for(i=0;i<R;P[i++]=0);while(l){while(!(s=m[l]))l++;if
(!Q(s,"\"")){U("<>",'#');U("<=",'$');U(">=",'!');}d=B;while(*F=*s){*s=='"'&&j
++;if(j&1||!Q(" \t",F))*d++=*s;s++;}*d--=j=0;if(B[1]!='=')switch(*B){X'E':l=-1
X'R':B[2]!='M'&&(l=*--C)X'I':B[1]=='N'?gets(p=B),P[*d]=S():(*(q=Q(B,"TH"))=0,p
=B+2,S()&&(p=q+4,l=S()-1))X'P':B[5]=='"'?*d=0,puts(B+6):(p=B+5,printf("%d\n",S
()))X'G':p=B+4,B[2]=='S'&&(*C++=l,p++),l=S()-1 X'F':*(q=Q(B,"TO"))=0;p=B+5;P[i
=B[3]]=S();p=q+2;M[i]=S();L[i]=l X'N':++P[*d]<=M[*d]&&(l=L[*d]);}else p=B+2,P[
*B]=S();l++;}X'L':N printf(I)X'N':N free(m[i]),m[i]=0 X'B':_ 0 t('S',5,"w",N
fprintf(f,I))t('O',4,"r",while(fgets(B,R,f))(*Q(B,"\n")=0,G()))X 0:default:G()
;}_ 0;}G(){l=atoi(B);m[l]&&free(m[l]);(p=Q(B," "))?strcpy(m[l]=malloc(strlen(p
)),p+1):(m[l]=0,0);}O(S,J,'=',==,'#',!=)O(J,K,'<',<,'>',>)O(K,V,'$',<=,'!',>=)
O(V,W,'+',+,'-',-)O(W,Y,'*',*,'/',/)Y(){int o;_*p=='-'?p++,-Y():*p>='0'&&*p<=
'9'?strtol(p,&p,0):*p=='('?p++,o=S(),p++,o:P[*p++];}
+100
View File
@@ -0,0 +1,100 @@
Best Language Tool:
Diomidis Spinellis
Imperial College, University of London
Myrsinis 1
GR-145 62 Kifissia
Greece
Judges' comments:
Compile and run. Give the following lines as input:
OLD LANDER.BAS
RUN
Be sure not to run out of fuel!
Selected notes from the author:
This is the DDS-BASIC Interpreter (Version 1.00).
Immediate commands:
RUN LIST NEW OLD filename
BYE SAVE filename
Program commands:
variable names a to z variables initialized to 0 on RUN
FOR var = exp TO exp NEXT variable
GOSUB exp RETURN
GOTO exp IF exp THEN exp
INPUT variable PRINT string
PRINT exp var = exp
REM any text END
Expressions (ranked by precedence):
Bracketed expressions
number (leading 0 for octal, 0x for hex, else decimal), variable
Unary -
* /
+ -
= <>
> <
<= >=
(* and + are also used for boolean AND and boolean OR)
Boolean expressions evaluate to 0 for false and 1 for true
Editing:
- Line editor using line re-entry.
- A line number with nothing following it, deletes the line.
Input format:
- Free format positioning of tokens on the line.
- No space is allowed before the line number.
- Exactly one space is needed between the OLD or SAVE command and
the filename.
- ALL INPUT MUST BE UPPERCASE.
Limits:
Line numbers 1-10000
Line length 999 characters
FOR nesting 26
GOSUB 999 levels
Program Dynamically allocated
Expressions -32768 - 32767 for 16 bit machines,
-2147483648 - 2147483647 for 32 bit machines
Error checking / error reports:
No error checking is performed.
The message `core dumped' signifies a syntax or semantic error.
Hosting Environment:
ANSI C, traditional K&R C or OSF ANDF
ASCII or EBCIDIC character set
48K bytes memory
The Speed of DDS-BASIC Interpreter (Version 1.00). relative to
Microsoft Advanced BASIC 3.31 is Approximately 60%.
The code size could be further reduced by doing ugly things like
not declaring the return type of functions, not freeing memory,
#defining define, and joining lines. In its present 1536 character
form the program is reasonably portable (it may fail to run in a
tagged object architecture) and nicely formatted (it fits in an
80*25 screen).
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+69
View File
@@ -0,0 +1,69 @@
#include <stdio.h>
#define d define
#d b12(x) 12 x
#d a13(x) x 13
#d a16(x) x 16
#d a32(x) x 32
#d acb(x) x]
#d acc(x) x}
#d aco(x) x:
#d bco(x) :x
#d acp(x) x)
#d bef(x) EOF x
#d aeq(x) x=
#d afo(x) x for
#d age(x) x fgetc
#d asi(x) x stdin
#d aso(x) x stdout
#d bgt(x) >x
#d ai(x) x i
#d aj(x) x j
#d al(x) x l
#d ami(x) x-
#d bne(x) !=x
#d aob(x) x[
#d aop(x) x(
#d apl(x) x+
#d bpu(x) fputc x
#d bqm(x) ?x
#d aqm(x) x?
#d aqu(x) x'
#d ase(x) x;
#d awh(x) x while
#d axo(x) x^
#d a0(x) x 0
#d b13(x) 13 x
#d b16(x) 16 x
#d b19(x) 19 x
#d b48(x) 48 x
#d a64(x) x 64
#d b66(x) 66 x
#d bcb(x) ]x
#d bch(x) char x
#d bcm(x) ,x
#d acm(x) x,
#d bcp(x) )x
#d beq(x) =x
#d bex(x) extern x
#d bi(x) i x
#d bin(x) int x
#d bix(x) index x
#d bj(x) j x
#d bl(x) l x
#d alt(x) x<
#d bma(x) main x
#d bob(x) [x
#d boc(x) {x
#d bop(x) (x
#d bpl(x) +x
#d app(x) x++
#d bqu(x) 'x
#d bse(x) ;x
#d bst(x) *x
bma(acp(bop(app(bcp(ai(boc(ase(bch(a16(bl(alt(bob(ai(b66(ase(bcb(a0(bcm(aeq(bst(acb(bj(a64(bse(aob(bin(al(bi(aeq(bse(ai(bex(aop(bch(afo(bst(ase(bix(())))))))))))))))))))))))))))))))))))))))
bl(ai(bob(aob(bi(al(bcb(aop(beq(apl(b13(a13(bpl(aeq(bop(acb(bl(bob(a32(bi(bpl(apl(b16(bcb(ai(beq(b19(aob(bpl(bop(l))))))))))))))))))))))))))))))
bpl(acp(b48(acp(asi(bcb(aop(beq(age(bop(aeq(bi(ai(bgt(aop(b12(aop(bqm(awh(b12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
bne(acc(bef(ase(bcp(acp(aso(bpu(acm(ai(bop(aco(bop(acb(bj(al(beq(ami(bix(aj(axo(bop(a16(aob(bl(al(aqm(bcm(acp(acp(i))))))))))))))))))))))))))))))
+57
View File
@@ -0,0 +1,57 @@
Best Abuse of the C Preprocessor:
David Goodenough
anonymous organization
541 Commonwealth Ave,
Newton, MA 02159
USA
Judges' comments:
Compile and run. Try:
echo "to C or not to C" | dg
Some C preprocessors get confused about single quotes in certain cases.
In particular, the following source line:
Cb12(ase(bco(acp(bi(acp(bcp(acp(bpl(aqu(bqu(A))))))))))))))))))))))))))))))
may need to be changed to:
Cb12(ase(bco(acp(bi(acp(bcp(acp(bpl('A'))))))))))))))))))))))))))))
if your C preprocessor botches single quotes in cpp expansions.
Systems that have index() and don't strchr() (e.g., BSD) should
compile with without -Dindex=strchr.
Selected notes from the author:
If my preprocessor could hack it, I could write this as one single
line rather than 4, but when I do that I get a complaint "defines
nested too deeply".
Spoiler: (rot13 to read)
Guvf vf nabgure ebg13 wbo (oryvrir vg be abg) - gur #qrsvarf ner n
abiry jnl bs nqqvat gbxraf: '#qrsvar o12(k) 12 k' zrnaf gung ng
fbzr cbvag va gur fbhepr n 12 vf sbyybjrq ol gur pbzcerffrq arfgrq
qrsvarf. Gur o12 trgf gur cerivbhf pbzcerffvba nf na nethzrag, naq
cercraqf gur 12, guhf znxvat nabgure fgrc va gur erperngvba bs gur
fbhepr. Gur nkk() qrsvarf qb gur fnzr, ohg nqq gbxraf nsgre.
Nf sbe gur ebg13 nytbevguz, vg eryvrf ba vaqrk() gb svaq vs gur
punenpgre vf va gur frg N-Mn-m. y[] vf na neenl gung trgf svyyrq
jvgu:
"abcdefghijklmmmmnopqrstuvwxyzzzzABCDEFGHIJKLMMMMNOPQRSTUVWXYZZZZ"
Vs vaqrk() fnlf gur pune vf va gur nycunorg, gura kbe gur bssfrg
jvgu 16 gb genafyngr, naq bhgchg, bgurejvfr cnff vg hapunatrq.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+22
View File
@@ -0,0 +1,22 @@
#define C char
#define F X,perror("oops"),1
#define G getchar()
#define I ;if(
#define P putchar
#define Q 256
#define W ;while(
#define X return 0
#include<stdio.h>
long M,N,c,f,m,o,r,s,w;y(l){o^=l;m+=l+1;f=f*2+l+(f>>31&1);}int
O,S,e,i,k,n,q,t[69001];b(g){k=4 W g<k)y(P((C)(w>>--k*8)&255));w=0;}C D[Q*Q],h
[Q*Q];main(g,V)C**V;{I**V-97)X,a()W G-10)W(g=G)+1&&g-'x')if(g-10){I
4<k)b(0)I g>32&g<'v')w=w*85+g-33,++k;else{I
g-'z'|k)F;w=0;k=5;}}W G-78)I scanf("%ld%lx E%lx S%lx R%lx ",&M,&N,&c,&s,&r)-5)F
I M){b(g=3-(M-1&3))W g--)y(0);}I(M-N|c-o|s-m|r-f)&4294967295)F;X;}long
g(){C*p I m<f&n<k&&(m=(1L<<++n)-1)||O>=S){O=0;S=fread(D,1,n,stdin)*8 I
S<8)X-1;S-=n-1;}p=D+O/8;q=O&7;O+=n;X,(1<<8-q)-1&*p>>q|m&((15<n+q)*p[2]*Q|p[1]&
255)<<8-q;}a(){C*p=D+Q;G;G;k=G;e=k>>7&1;k&=31 I k>16)F;w=Q
W w--)t[w]=0,h[w]=w;n=8;f=Q+e;i=o=w=g()I o<0)X,1;P(i)W(w=g())+1){I
w==Q&e){W w--)t[w]=0;m=n=8;f=Q I(w=g())<0)X;}c=w
I w>=f)*p++=i,w=o W w>=Q)*p++=h[w],w=t[w];P(i=h[w])W
p>D+Q)P(*--p)I(w=f)<1L<<k)t[w]=o,h[f++]=i;o=c;}X;}
+220
View File
@@ -0,0 +1,220 @@
Best Entropy-reducer:
James A. Woods
Research Institute for Advanced Computer Science
MS 230-5
NASA Ames Research Center
Moffett Field, CA 94131
USA
Karl F. Fox
Morning Star Technologies, Inc.
1760 Zollinger Road
Columbus, OH 43221
USA
Paul Eggert
Twin Sun Inc.
360 N. Sepulveda Blvd. #2055
El Segundo, CA 90245
USA
Judges' comments:
The program, in its base form, implements two useful utilities:
atob - ascii to binary conversion
zcat - decompression filter
To test the official C entry, one might try:
echo "Quartz glyph jocks vend, fix, BMW." | compress | btoa | jaw
which should apply the identity transformation to a minimal
holoalphabetic sentence.
Included with this entry is a shell script (with comments edited down
to reduce it to 1530 bytes) which implements the complete
shark utility. The script, shark.sh, contains a 'jaw.c' embedded
within it!
The sender must have 'compress' and 'btoa'. To send, try:
sh shark.sh jaw.* > receive
The resulting file, 'receive', unpacks the input files
even if the receiver lacks 'uncompress' and 'atob':
mkdir test
cd test
sh ../receive
cmp ../jaw.c jaw.c
cmp ../jaw.hint jaw.hint
Selected notes from the authors:
ABSTRACT
Minimal, Universal File Bundling
(or, Functional Obfuscation in a Self-Decoding Unix Shell Archive)
James A. Woods
Universities Space Research Association
NASA Ames Research Center
"Use an algorithm, go to jail."
[anon., circa 1988, pre-Morris worm era]
Myriad formats have been proposed for network-mailable
data. A major difficulty undermining the popularity of most
file/message bundlers is that the sender assumes prior
installation of the computational dual of such bundling
software by the receiver. Command shell archives alleviate
this problem somewhat, but still require standardization for
the function of data compression and mail-transparency
encoding. On Unix, these coding format quandaries are over-
come by planting a novel Trojan Horse in the archive header
to perform negotiationless decoding.
Specifically, we outline the development of an extraor-
dinarily compact portable (un)bundler to (dis)assemble
data-compressed, binary-to-ASCII-converted, length-split,
and checksummed directory structures using standard Unix
tools. Miniature versions of counterparts to a Lempel-Ziv
coder ('compress' or 'squeeze') and an efficient bit packet-
izer ('btoa') are compiled on-the-fly at mail destination
sites where they may not already exist. These are written
in purposefully obfuscated-C to accompany similarly-shrunk
shell command glue. This resulting shell archiver is dubbed
'shark'.
'Shark' procedure overhead consumes as few as three
dozen shell lines (or ~1100 bytes), commensurate with the
size of many Internet mail headers; it amortizes favorably
with message size. 'Shark' is portable across Unix vari-
ants, while the underlying technique is inherently general-
izable to other encoding schemes.
In the function-theoretic sense of minimal
Chaitin/Kolmogorov complexity, and within a modified Shannon
model of communication, the 'shark' effort aims to construct
a "shortest program" for source decoding in the Turing-
universal Unix environment.
----------------------------------------------
Oh, the shark has pretty teeth, dear--
And he shows them pearly white
Just a jackknife has Macheath, dear--
And he keeps it out of sight.
[Bertolt Brecht, Threepenny Opera]
----------------------------------------------
We have ported this program to a wide variety of systems. Among
these are:
SunOS 4.1 / Sun Sparcstation 1 (using both 'cc' and 'gcc 1.37.1')
SunOS 4.0.3 / Sun 3
BSD 4.3 / VAX 8650
SEIUX / Sumitomo Electric Ustation/S
Sony NEWS-OS 3.3 / Sony NEWS (fairly vanilla 4.3BSD)
System V.? / Hitachi 2050
System V.? / NEC EWS 4800
UNIOS-B / Omron Luna
Dynix / Sequent Balance ('cc' for Natl. Semi. base + 'gcc 1.36')
Unicos / Cray 2
We (the authors) feel this program is obfuscated for the
following reasons:
(0) This is one of the few programs you'll see WHOSE VERY UTILITY
DEPENDS ON ITS OBFUSCATION!
(1) The contest entry may be used to send its wonderful self to
anyone in the Unix world! Virus writers need not apply...
(2) The basic idea is twisted enough to be patentable, but is,
out of the kindness of our hearts (as well as to maintain
eligibility for the large IOCCC prize fund), dedicated to
the public domain. Claude Shannon, meet Alan Turing.
(3) Meta-obfuscation is via obfuscated description (see ABSTRACT).
(4) "Literary" allusion. Production code contains a reference to
self-reference, preserved at amazing cost for sheer perversity.
(5) Many, many micro obfuscations below, honed over three years
time, in shell as well as C. Ask about the 'tar' pit escape,
the argv[0] flip, Paul's &4294967295 portability hack, the
"void where prohibited by flaw" fix, the scanf() spacesaver,
shift shenanigans, signal madness, exit()ing stage left, and
source-to-source transformations galore.
For extra credit:
Construct 'sharkmail', to auto-split sharkives into mailable
segments and mail them. Here's a simple one, which could be
extended to enable auto-reassembly with one shell cmd at the
far end.
------------------------ cut here for sharkmail -----------------------
#!/bin/sh
m=$1; shift
shark $* | split -800 - /tmp/shark$$
n=`ls /tmp/shark$$* | wc -l | sed 's/ *//'`
p=0
for f in `ls /tmp/shark$$*`
do
p=`expr $p + 1`
mail -s "bundle ($p of $n) from '`whoami`'" $m < $f
done
rm /tmp/shark$$*
------------------------ end of sharkmail -----------------------------
Shark history:
May 1987: Karl Fox introduces 1023-byte zcat.c to USENET.
It's too late for the 4th IOCCC.
May 21, 1987: James A. Woods extends idea to construct self
decompressing shar Trojan horse, utilizing 'cc', 'shar',
'zcat', & 'atob'; size: 2303 bytes.
May 23, 1987: 'jaw' trims 250 bytes without much thought.
June 2, 1987: 52 lines of shell, 1991 bytes, now made with 'tar',
short-circuit C-compile at far end, dual-use main.c,
portability mods. (jaw)
Mar-May 1988: abortive run at 5th IOCCC.
jaw.c - 1529 bytes. compile line: 152 bytes.
generated funny code with execvp() to invoke shell.
Aug 29, 1988: production version, now at 1830 bytes.
Jan 1990: Paul Eggert does tour-de-force shark re-engineering.
May 24, 1990: collaboration yields 999-byte jaw.c core (see above)
and 1530-byte production shell code (w/comments).
Eggert comes through with lion's share of improvements.
7th IOCCC code now faster than the atob/zcat it replaces.
May 1990: 'jaw' develops experimental replacement using
Dan Bernstein's high-compression 'squeeze'.
To which we add:
June 1990: 'shark' wins the IOCCC, finally! :-)
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+14
View File
@@ -0,0 +1,14 @@
#include <stdio.h>
#define A(a) G a();
#define B(a) G (*a)();
#define C(a,b) G a() { printf(b); return X; }
typedef struct F G;A(a)A(b)A(c)A(d)A(e)A(f)A(g)A(h)A(i)A(j)A(k)A(l)A(m)A(n)A(
o)A(p)A(q)A(r)A(s)A(t)A(u)A(v)A(w)A(x)A(y)A(z)A(S)A(N)void Q();struct F{B(a)B
(b)B(c)B(d)B(e)B(f)B(g)B(h)B(i)B(j)B(k)B(l)B(m)B(n)B(o)B(p)B(q)B(r)B(s)B(t)B(
u)B(v)B(w)B(x)B(y)B(z)B(S)B(N)void(*Q)();}X={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,
q,r,s,t,u,v,w,x,y,z,S,N,Q};C(a,"z")C(b,"y")C(c,"x")C(d,"w")C(e,"v")C(f,"u")C(
g,"t")C(h,"s")C(i,"r")C(j,"q")C(k,"p")C(l,"o")C(m,"n")C(n,"m")C(o,"l")C(p,"k"
)C(q,"j")C(r,"i")C(s,"h")C(t,"g")C(u,"f")C(v,"e")C(w,"d")C(x,"c")C(y,"b")C(z,
"a")C(S," ")C(N,"\n") void Q(){}main(){X=g().s().v().S().j().f().r().x().p().
S().y().i().l().d().m().S().u().l().c().S().q().f().n().k().v().w().S().l().e
().v().i().S().g().s().v().S().o().z().a().b().S().w().l().t().N();}
+65
View File
@@ -0,0 +1,65 @@
Most Unusual Data Structure:
Peter J Ruczynski.
Pyramid Technology Ltd.
Pyramid House,
Solatron Road
Farnborough.
Hants GU14 7PL
England, U.K.
Judges' comments:
This program prints out a string. Can you figure out how
it is done?
By use of pointers to functions returning a struct of pointers
to functions!
Note that some compilers will be unable to compile the
expression 'X=g()...' in main due to lack of temporary
value space. One might want to try replacing main with:
main(){X=s().v().o().o().l().S().d().l().i().o().w().N();}
if this is a problem.
Spoiler: (rot13 to read)
Guvf cebtenz cevagf bhg gur fgevat:
gur dhvpx oebja sbk whzcrq bire gur ynml qbt
ol hfr bs cbvagref gb shapgvbaf ergheavat n fgehpg bs cbvagref
gb shapgvbaf!
Selected notes from the author: (rot13 to read)
Vg vf fvzcyr gb znxr gur cebtenz cevag bgure fgevatf. Rnpu
nycunorgvpny punenpgre sebz n gb m vf cevagrq bhg nf vgf
bccbfvgr:
n->m o->l p->k rgp
Gb rapbqr n arj fgevat vachg gur fgevat nf vg vf zrnag gb pbzr bhg:
K=f().i().b().b().y().F().q().y().v().b().j().A();
Abgr: F() ercerfragf n fcnpr naq A() n arjyvar. Guvf jvyy abj
cebqhpr...
uryyb jbeyq
By the way, there is actually a piece of code which is not used
in the original program! I leave it as an intellectual exercise
to the reader to find out what it is.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+224
View File
@@ -0,0 +1,224 @@
7th International Obfuscated C Code Contest Rules
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
Obfuscate: tr.v. -cated, -cating, -cates. 1. a. To render obscure.
b. To darken. 2. To confuse: Their emotions obfuscated their
judgment. [LLat. obfuscare, to darken : ob(intensive) +
Lat. fuscare, to darken < fuscus, dark.] -obfuscation n.
obfuscatory adj.
GOALS OF THE CONTEST:
* To write the most Obscure/Obfuscated C program under the rules below.
* To show what should NOT be done in C programs.
* To provide a safe forum for poor C code. :-)
DEDICATION:
The 1990 International Obfuscated C Code Contest is dedicated to ANSI C.
RULES:
To help us handle the vast volume of entries, we ask that you
follow the rules below. Sorry for the length, but we need all
the help we can get!
1) Your source MUST be 1536 bytes or less, and it must be a complete
program, not just a subroutine.
2) To help us process your entries, we ask that you submit entries
in the following format. Please be sure to include ALL --- lines,
otherwise our extraction program may skip your entry!
---header items---
name: Your name, of course!
org: School/Company/Organization
email address: Email address from a well known site, or in a registered domain
postal address: Postal address
include your country as well
environment: Indicate the Hardware
and OS under which your program was tested
entry: 5 <number of entries sent so far including this one>
remarks: Remarks may be continued with leading whitespace until the
line ---how to compile-- is encountered. (see #3 below)
---how to ANSI compile---
X Give the command(s) needed to compile your program using an ANSI C
X compiler. If you program should not be compiled under an ANSI C compiler,
X leave this section blank. Follow the format rules for the program
X section below, except that command size must be 160 characters or less.
---how to common compile---
X Give the command(s) needed to compile your program using an K&R/traditional
X C compiler. If you program should not be compiled under a K&R style C,
X leave this section blank. Follow the format rules for the program section
X below, except that command size must be 160 characters or less.
---program---
X Place obfuscated source of 1536 characters or less in this section.
X Add a leading X to each line to avoid problems with mailers.
X Some mailers don't like files with very long lines. If your entry contains E
C lines longer 80 chars we ask you to form continuation line sets. To form E
C a continuation line set, place an 'E' character at the point of a split E
C and place a C (instead of an X) at the beginning of the next line. E
C Finally, end the continuation line set as normal.
X The E\nC's and leading X's will be removed prior to extraction and thus E
C they don't contribute toward the source character count. All other E
C characters are considered to be source. Whitespace after 'X' or 'C' E
C and before the 'E' is significant, we added it here for readability.
X Newlines and tabs each count as 1 character. Assume 8 character tab stops.
X If your entry does not end in a newline, leave a final 'E' on the end. E
---end---
3) Regarding the header items:
* Any text outside of the above format will be kept confidential.
* All header lines are required, but you may use 'anonymous'
for any header line other than 'remarks' or 'entry'.
* In the 'remarks' please include:
- what this program does
- why you think the program is obfuscated
- any other remarks (humorous or otherwise)
4) Your entry should be written in common C (K&R + common extensions)
or ANSI C. If your program will NOT compile under an ANSI C or
K&R C compiler, leave the particular 'how to' section blank.
You do not have to fill in both 'how to' sections, though you must
fill in at least one 'how to' section.
If you leave a 'how to' section blank, include the '---' line, but
but having no command lines after it.
5) The program must be of original work. All programs must be
in the public domain. All copyrighted programs will be rejected.
6) Entries must be received between 16-Mar-90 0:00 GMT and
26-May-90 0:00 GMT. Email your entries to:
...!{sun,pacbell,uunet,utzoo,pyramid,amdahl}!hoptoad!obfuscate
We will attempt to Email a confirmation of receipt of contest
entries, however since Email is not reliable you may not receive it.
We regret that we can no longer accept entries via postal mail.
7) Each person may submit up to 8 entries. Multiple entries must
be sent in separate Email letters.
8) Entries that can not be built automatically in a portable makefile
are not allowed. (e.g., don't use #include "/dev/tty")
9) Starting this year, compiling entries must result an regular file
which can be executed. (No -o /dev/tty or similar compile lines)
ANNOUNCEMENT OF WINNERS:
* First announcement will likely be at the Summer 90 Usenix BOF.
* Winning entries will be posted in mid June 1990 to
comp.sources.unix as well as news groups where these rules
were posted. (depending on the judges work load)
* Winning entries will be deposited into the uunet archives.
* An article containing the winning entries will be published
in a future issue of the "Micro/Systems Journal".
* Winners receive international fame and flames! :-)
JUDGING:
Awards will be given to the best entry in a number of categories.
The actual category list will vary depending on the types of entries
we receive. As a guide, consider using the following:
* The best small one line program
* The strangest source layout
* The most useful obfuscated program
* The most creatively obfuscated program
* Best obfuscated entry smaller than 256 bytes
* Best obfuscated entry smaller than 1024 bytes
* Best abuse of ANSI
* Worse abuse of the rules (no abuse of entry format please!)
* <anything else so strange that it deserves an award>
POINTS TO PONDER:
People are encouraged to examine winners of the previous
contests. A copy of these entries was posted to
comp.sources.unix. Contact the comp.sources.unix moderator, or
some archive site (such as uunet). Keep in mind that rules
change from year to year, so some winning entries may not be
valid entries this year. What was unique and novel one year
might be 'old' the next year. In short, use your best judgment.
We examine each entry on several levels of confusion. For example
each entry is judged when we:
* look at the original source
* run it through: sed -e ',^#[ ]*define,d' | /lib/cpp
* run it through: sed -e ',^#[ ]*include,d' | /lib/cpp
* run it through a C beautifier
* examine the algorithm
* compile and lint it
* execute it
One line programs are best when they are short, obscure and concise.
We tend to dislike programs that:
* are very hardware specific
* are very OS or Un*x version specific
(index/strchr differences are ok, but socket/streams specific
code is likely not to be)
* dump core or have compiler warnings
(it is ok only if you warn us in the 'remark' header item)
* won't compile under both BSD or SYS V Un*x
* use an excessively long compile line to get around the size limit
* are longer than they need to be
* are similar to previous winners
* are similar to previous losers :-)
Simply abusing #defines or -Dfoo=bar won't go as far as a program
that is more well rounded in confusion.
Unless you are cramped for space, or unless you are entering the
'best one liner' category, we suggest that you format your program
in a more creative way than simply forming excessively long lines.
We like programs that:
* are as concise and small as they need to be
* do something quasi-interesting
* pass lint without complaint (particularly strict ANSI ones)
* are portable
* are unique or novel in their obfuscation style
* MAKE USE OF A NUMBER OF DIFFERENT TYPES OF OBFUSCATION
* make us laugh and/or throw up :-)
Some types of programs can't excel in some areas. Of course, your
program doesn't have to excel in all areas, but doing well in several
areas really does help.
Be creative!
The Judging will be done by Landon Noll and Larry Bassel. If you have
any QUESTIONS or COMMENTS, please feel free to send them to:
...!{sun,pacbell,uunet,pyramid,amdahl}!hoptoad!judges
judges@toad.com
however contest entries should be sent to:
...!{sun,pacbell,uunet,pyramid,amdahl}!hoptoad!obfuscate
obfuscate@toad.com
chongo <Landon Curt Noll> /\cc/\ hoptoad!chongo
Larry Bassel {amdahl,ucbvax,cbosgd}|sun!lab
+46
View File
@@ -0,0 +1,46 @@
char*a??(??)=??<
"??=include<stdio.h>",
"??=include<stdlib.h>",
"??=define o stdout",
"??=define b break;case",
"??=define s(p)fputs(p,o);",
"??=define c(p)fputc(p,o);",
"void t(p,f)char*p;??<f&&c('??/"')",
"for(;;p++)??<switch(*p)??<case 0:f&&",
"s(??/"??/??/??/",??/")c('??/??/n')return;case",
"'??=':s(??/"???/??/?=??/")b'??<':s(??/"???/??/?<??/")",
"b'??>':s(??/"???/??/?>??/")b'??(':s(??/"???/??/?(??/")b'??)'",
":s(??/"???/??/?)??/")b'??/??/??/??/':f&&s(??/"???/??/?/??/")",
"s(??/"???/??/?/??/")b'??/??/n':if(f)s(??/"???/??/?/n??/")",
"else case'??/"':if(f)s(??/"???/??/?/??/??/??/"??/")",
"else default:c(*p)??>??>??>main()??<char**p",
";t(??/"char*a??(??)=??<??/",0);for(p=a;*p",
";p++)t(*p,1);t(??/"0??>;??/",0);for(p=a",
";*p;p++)t(*p,0);exit(!ferror(o)&&",
"!fclose(o)?EXIT_SUCCESS",
":EXIT_FAILURE);",
"/*NOTREACHED*/",
"??>",
0??>;
??=include<stdio.h>
??=include<stdlib.h>
??=define o stdout
??=define b break;case
??=define s(p)fputs(p,o);
??=define c(p)fputc(p,o);
void t(p,f)char*p;??<f&&c('"')
for(;;p++)??<switch(*p)??<case 0:f&&
s("??/",")c('??/n')return;case
'??=':s("???/?=")b'??<':s("???/?<")
b'??>':s("???/?>")b'??(':s("???/?(")b'??)'
:s("???/?)")b'??/??/':f&&s("???/?/")
s("???/?/")b'??/n':if(f)s("???/?/n")
else case'"':if(f)s("???/?/??/"")
else default:c(*p)??>??>??>main()??<char**p
;t("char*a??(??)=??<",0);for(p=a;*p
;p++)t(*p,1);t("0??>;",0);for(p=a
;*p;p++)t(*p,0);exit(!ferror(o)&&
!fclose(o)?EXIT_SUCCESS
:EXIT_FAILURE);
/*NOTREACHED*/
??>
+65
View File
@@ -0,0 +1,65 @@
ANSI Committee's Worst Abuse of C:
Larry Jones
SDRC
2000 Eastman Dr
Milford, OH 45150
USA
Judges' comments:
The addition of trigraphs has made it easier to make programs
hard to read. It was a dark and stormy night for C when the
ANSI C committee added trigraphs to the standard. Too bad
that they didn't just simply require a more reasonable ISO
character set.
The common.mk (non-ANSI) makefile uses sed to form scjones.alt.c.
The scjones.alt.c is similar to the original scjones.c source,
but with all the trigraphs converted. You might want to try:
make -f common.mk scjones.alt.c
even if you only have an ANSI compiler, just to see how
the trigrapsh are converted.
WARNING: In the future, we will be passing ANSI programs through a
trigraph filter before reading. Trigraph-ifacation will
not be a major consideration in future contests. People
should exploit more interesting features of ANSI C.
Selected notes from the author:
Since this year's contest is dedicated to ANSI C, here is a
strictly conforming entry. In accordance with the ANSI
definition of a strictly conforming program it does not produce
output dependent on any unspecified, undefined, or implementation
defined behavior, and it does not exceed any of the minimum
implementation limits. It adheres to all of the syntactic and
semantic constraints of the standard, #includes the relevant
headers for the functions it uses, and uses the EXIT_SUCCESS and
EXIT_FAILURE macros to return a correct success/fail status to
the invoking program. It also uses trigraphs for characters
which are not in the Invariant Code Set of ISO 646:1983, so it
will be portable to machines with deficient (from C's standpoint)
character sets. In short, it should be very widely portable. As
an extra added attraction, all of the lines are under 72
characters long, which would allow for sequence numbers to be
punched in columns 73-80 :-).
[[ The Author sent us this note after he was informed that he won ]]
Although I am quite grateful for the "ANSI Committee's Worst Abuse
of C" title (were you aware that I am a member of the committee or
is the double meaning unintentional?), I was really hoping for
something more along the lines of "Closest Resemblance to Line Noise." :-)
[[ ... it was unintentional ]]
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+47
View File
@@ -0,0 +1,47 @@
for i in "${@?${usage?$0 file...}}";do<"$i"||exit;done
(cat&&tar cbf 1 - "$@"|compress|btoa&&echo w)<<\Z
#!/bin/sh
#
# GENTLE READER -- write this message to file [no headers!]; run "sh file".
#
# [un]shark: By James A. Woods.
# Seed planted by Karl Fox; code intensified by Paul Eggert.
#
# "Cleverly he dialed from within." -- D. Van Vliet, "Trout Mask Replica"
#
PATH=$PATH:. a=atob m=unshark z=zcat
r="rm -f $a $m* $z" v="cc -o $z $m.c"
trap "$r;exit 1" 1 2 13 15
echo decoding...
(:|compress|btoa|$a|$z)2>$m>&2||(sed '1,9s/./#define & /
s/@/[w]/g
s/C/char /g
s/I/;if(/g
s/W/;while(/g
s/Y/%lx /g
s/}/;}/g'>$m.c<<_&&
FX,perror("$m bite: resend"),1;
GgetC()
H(w=g())
K[69001]
PputC
Q256
U*p
Xreturn 0
Zw=QWw--)t@=0
#include<stdio.h>
long M,N,c,f,m,o,r,s,w;y(l){o^=l;m+=l+1;f=f*2+l+(f>>31&1)}int
O,S,e,i,k,n,q,t K;b(g){k=4Wg<k)y(P((C)(w>>--k*8)&255));w=0}CD K,h
K;main(g,V)C**V;{I**V-97)X,a()WG-10)W(g=G)+1&&g-'x')if(g-10)
{I4<k)b(0)Ig>32&g<'v')w=w*85+g-33,++k;else{Ig-'z'|k)F
w=0;k=5}}WG-78)Iscanf("%ldYEYSYRY",&M,&N,&c,&s,&r)-5)F
IM){b(g=3-(M-1&3))Wg--)y(0)}I(M-N|c-o|s-m|r-f)&4294967295)F X}long
g(){CUIm<f&n<k&&(m=(1l<<++n)-1)||O>=S){O=0;S=fread(D,1,n,stdin)*8IS<8)X-1;
S-=n-1}p=D+O/8;q=O&7;O+=n;X,(1<<8-q)-1&U>>q|m&((15<n+q)U[2]*Q|p[1]&255)<<8-q}
a(){CU=D+Q;G;G;k=G;e=k>>7&1;k&=31Ik>16)F
Z,h@=w;n=8;f=Q+e;i=o=HIo<0)X,1;P(i)WH+1){Iw==Q&e){Z;m=n=8;f=QIH<0)X}
c=wIw>=f)U++=i,w=oWw>=Q)U++=h@,w=t@;P(i=h@)Wp>D+Q)P(*--p)
I(w=f)<1l<<k)t@=o,h[f++]=i;o=c}X}
_
($v||$v -Mh)&&ln $z $a)&&$a<<\w>$m-&&$z<$m->$m&&tar xvf $m&&$r
Z
+1
View File
@@ -0,0 +1 @@
c
+62
View File
@@ -0,0 +1,62 @@
Strangest Abuse of the Rules:
Stig Hemmer
Norwegian Institute of Technology
N-7034 Trondheim-NTH
Norway
Judges' comments:
We changed the alias that the author's suggested alias from a
C-shell alias to a Korn shell alias because many C-shells
did not allow Stig Hemmer's form of aliasing. (The error
may have also been due to some uucp site corrupting his
entry) Below is the author's 'how to compile' sections as
mailed to us:
---how to ANSI compile---
Xecho alias c cc -E -o o.c shst.c -"\''Dc=main(){printf("\"N%sested E
Ccomments allowed.\\n\",'/*/*/0*/**/'1?\"\":\"o n\"");}'\'';cc -o c o.c'
Xsource shst.c"|csh
---how to common compile---
Xecho alias c cc -E -o o.c shst.c -"\''Dc=main(){printf("\"N%sested E
Ccomments allowed.\\n\",'/*/*/0*/**/'1?\"\":\"o n\"");}'\'';cc -o c o.c'
Xsource shst.c"|csh
Note that shst.c is renamed to stig.c in the distribution.
Producing an equivalent C-shell alias or /bin/sh function
is left as an exercise to the reader.
WARNING: This program's 'how to compile' is too specific to a particular
shell. The obfuscation of this program to more related to
shell obfuscation than C obfuscation. This type of entry will
not be permitted in future contests.
Selected notes from the author:
If you like shell programming you may also admire my
creative quoting. (I use echo to create an alias
which when run calls cc with the -D option to create a
C macro with double quotes in it. ARRRRRGGGHHH!)
The program is totally portable, but the compile
commands are very shell specific so don't be TOO mad
at me if they don't work for you.
If you want to put these commands in a Makefile you
must add 4 - four - backslashes at the end on first
line. (At least that's what works here.)
If everything works correctly it create an executable
named c which checks whether your compiler supports
nested comments. I've stolen the "/*/*/0*/**/1" from
somewhere so don't give me any points for it. Of
course neither ANSI nor K&R support nested comments
when properly implemented, but what the heck.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+1
View File
@@ -0,0 +1 @@
alias c="cc -E stig.c -Dc='main(){printf(\"N%sested comments allowed.\\n"'",/*/*/0*/**/1?"":"o n"'");}'|grep -v '^#'>o.c;cc -o o o.c;o"
+23
View File
@@ -0,0 +1,23 @@
#define D ,close(
char *c,q [512 ],m[ 256
],*v[ 99], **u, *i[3];int f[2],p;main (){for
(m[m [60]= m[62 ]=32 ]=m[* m=124 [m]= 9]=6;
e(-8) ,gets (1+( c=q) )|| exit (0); r(0,0)
)for( ;*++ c;); }r(t, o){ *i=i [2]= 0;for
(u=v +98 ;m[*--c] ^9;m [*c] &32 ?i[*c
&2]= *u,u- v^98 &&++u:
3 )if(!m[*c]){for(*++c=0;!m[*--c];);
* --u= ++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[
1 ]:
4 ,(p=fork())?e(p),o?r(o,0)D o)D*f):
1 ,wait(0):(o?dup2(*f,0)D*f)D o):*i?
5 D 0),e(open(*i,0)):
9 ,t?dup2(t,1)D t):i[
2 ]?
6 D 1),e(creat(i[2],438)):
5 ,e(execvp(*u,u))):e(chdir(u[1])*2):
3 ;}e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||exit(1):
5 ;}
+90
View File
@@ -0,0 +1,90 @@
Best Utility:
Byron Rakitzis Sean Dorward
Princeton University Princeton University
5707 Old Lodge Dr. 10274 Burleigh Cottage Lane
Houston, TX 77066 Ellicott City, MD 21043
USA USA
Judges' comments:
This program implements a subject a well known Un*x utility whose
original source was considered to be extremely obfuscated by many
people, excluding its author. In fact, this utility one a major
inspiration for the formation of this contest.
The author supplied us with a slightly smaller unformatted version
of the program which we include below:
#define D ,close(
char*c,q[512],m[256],*v[99],**u,*i[3];int f[2],p;main(){for(m[m[60]=m[62]=
32]=m[*m=124[m]=9]=6;e(-8),gets(1+(c=q))||exit(0);r(0,0))for(;*++c;);}
r(t,o){*i=i[2]=0;for(u=v+98;m[*--c]^9;m[*c]&32?i[*c&2]=
*u,u-v^98&&++u:3)if(!m[*c]){for(*++c=0;!m[*--c];);*--u=
++c;}u-v^98?strcmp(*u,"cd")?*c?pipe(f),o=f[1]:1,(p=fork())?e(p),o?
r(o,0)D o)D*f):4,wait(0):(o?dup2(*f,0)D*f)D o):*i?1 D
0),e(open(*i,0)):5,t?dup2(t,1)D t):i[2]?9 D
1),e(creat(i[2],438)):2,e(execvp(*u,u))):e(chdir(u[1])*2):6;}
e(x){x<0?write(2,"?\n$ "-x/4,2),x+1||exit(1):5;}
Selected notes from the author: (rot13 to read)
Guvf cebtenz vf n ehqvzragnel furyy. Vg qbrf v/b erqverpgvba, cvcrf
naq pq. Vg syntf reebef ba snvyrq puqve'f, bcra'f, perng'f
rkrpic'f, sbex'f naq n srj flagnk reebef.
Guvf cebtenz vf boshfpngrq va n srj abgnoyr jnlf: ncneg sebz gur
ynlbhg (na hasbeznggrq (ohg pehapurq) irefvba vf vapyhqrq sbe
crbcyr jub jnag gb chg guvf guebhtu po) vg znxrf pyrire hfr bs n
jevgr fgngrzrag, fb gung gur fnzr fgngrzrag pna or hfrq gb cevag
reebef naq gur cebzcg. Ol pnyyvat gur reebe shapgvba jvgu gur inyhr
-8, gur cbvagre bssfrg va gur rkcerffvba "?\a$ "-k/4 tbrf sebz 0 gb
2. Cerfgb! N cebzcg. Sbe reebef jvgu ahzoref fznyyre guna -4
(v.r., HAVK flfgrz pnyyf) n dhrfgvba znex vf cevagrq.
Gur reebe inyhr bs puqve vf qbhoyrq fb gung jr qba'g rkvg sebz gur
cnerag furyy ba n puqve reebe (fvapr r() rkvgf ba -1 reebef bayl).
Nyy bgure flfgrz pnyy snvyherf rkvg fvapr gurl ner sebz fhofuryyf.
Erphefvba vf farnxvyl rzcyblrq gb nibvq n frpbaq pnyy gb sbex(),
naq gur yvar vf cnefrq va n snveyl ovmneer snfuvba: onpxjneqf. Gur
urneg bs gur cebtenz, gung vf, gur cneg juvpu cresbezf nyy sbexf,
rkrpf, bcraf, rgp. vf BAR P FGNGRZRAG.
Gur zrgn-inyhrf neenl vf vavgvnyvmrq va n ovmneer snfuvba, naq gur
fhofrdhrag purpxf sbe gur '<' naq '>' ner cresbezrq va n fvatyr
fgngrzrag hfvat n znfx, fvapr lbh xabj gung '>'&2 vf 0, jurernf
'<'&2 vf 2. Bgure fhpu zvpeb-boshfpngvbaf nobhaq.
Svanyyl, vg vf abgnoyr gung gur pbqr jnf unpxrq sbe zvavznyvgl. Vs
lbh ybbx ng gur pbzcerffrq irefvba, lbh jvyy or uneq-cerffrq gb
ryvzvangr zber guna n srj punenpgref (jr pna'g frr ubj gb znxr vg
nal fznyyre!). 550 punenpgref vf cerggl yrna sbe n furyy gung qbrf
guvf zhpu.
OHTF
Gur flagnk bs gur furyy unf abg orra shyyl rkcyberq, ohg vs lbh gel
gb erqverpg va gur fnzr qverpgvba zber guna bapr, bayl bar
erqverpgvba vf cresbezrq. Guvf vf n "srngher" bs gur jnl gur yvar
vf cnefrq; n cbvagre gb gur fgnpx bs nethzragf vf nffvtarq naq na
nethzrag vf fgbyra rirel gvzr n ">" be "<" vf rapbhagrerq. Gur
furyy syntf na reebe vs ab nethzragf ner ba gur fgnpx. Guhf, sbe
rknzcyr:
png > sbb > one
pngf gb sbb, fvapr vg jnf chfurq ynfg, ohg
png > > sbb one
pngf gb one, fvapr one jnf chfurq haqre sbb. (erzrzore jr'er
cnefvat evtug-yrsg)
Qrcraqvat ba lbhe synibe bs HA*K, pq jvgubhg na nethzrag jvyy
rvgure cebqhpr na reebe be whfg qb abguvat.
Gurer vf whfg bar reebe zrffntr, gur dhrfgvba znex, ohg url, gung'f
nyy rq qbrf gbb.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+93
View File
@@ -0,0 +1,93 @@
#include <stdio.h>
#include <math.h>
#define X
#define Y {}
#define C }
#define o {
#undef main
char m[500][99],v[99],R;
int*a,b,n,i,j,W,A;
float Q,G,D,M,T,B,O,U,V,N,y,e();
P(g,R,u)float*g,R,u;{int c;for(*g=1,c=u;c--;*g*=R);}
X
K(g,R,u)float*g,u;char R;
o
if(R=='+')*g+=u;
if(R=='-')*g-=u;
if(R=='*')*g*=u;
if(R=='/')*g/=u;
if(R=='^')P(g,*g,u);
C
w(g,R,u)float*g,u;char R;
/**/{int b,f;A=atoi(*++a);b=atoi(*++a);while((f=A+b)<15000){printf("%d\n",f);A=b;b=f;}}
main(A,a)int A;char*a[];
o o
if(!strcmp(*++a,"-r"))S();
D=atof(*++a);
T=atof(*++a);
B=atof(*++a);
M=atof(*(4+(a-=3)));
C
while(D<T)
o
U=e((G=B/2,*a),D,M,a);
V=e(*a,Q=D+G,M+G*U,a);
/*/
z;/*/
N=2*e(*a,Q,M+G*V,a);
M+=B*V/3+B*N/6+B*e(*a,D+=B,M+G*N,a)/6+G*U/3;
printf("%f %f\n",D,M);
C
while(T=0)
;
W=D=1;
;
while(W!=1)
o o
strcpy(j+m,v);
o
if((j-=W)<=W)break;
strcpy(j+m,m+j-W);
C
while(strcmp(m+j-W,v)>0)
j=i;
strcpy(v,i+m);
C
for(i=(W/=3)-1;++i<n;)
;
C
do
;
while(0);
for(W=1;(W=W*3+1)<n;);
C
float e(f,D,M,a)char*f,*a[];float D,M;
o
#define main L
O=0;
R='+';
for(;*f;f++)
if(*f=='y')K(&O,R,M);
else if((*f>='0')&&(*f<='9'))K(&O,R,(float)*f-'0');
else if(*f=='x')K(&O,R,D);
else if(1)R=*f;
if(1);
return O;
for(j=0;j<n;puts(j++[m]));
e("",O,&O,a);
n=j-(O=1);
while(gets(j++[m]));
if(!strcmp(*++a,"-r"))S();
C
/**/main(A,a)int A;char*a[];
Y
S(){while(gets(b++[m]));for(b--;b--;puts(b[m]));}
char*f,m[500][99],R,v[99];
int b,W,n,i,j,z;
float Q,G,D,M,T,O,B,U,V,N,e();
#define Y
#define X {}
#define o }
#define C {
#include <stdio.h>
#include <math.h>
+96
View File
@@ -0,0 +1,96 @@
Best of Show:
Adrian Mariano
University of Washington
2729 72nd Ave SE
Mercer Island, WA 98040
USA
Judges' comments:
The program's source implements four functions, all from the
same source file!
Usage:
theorem expression x1 x2 h y1
where:
expression - function f(x,y) (see below)
x1 - start of interval
x2 - end of interval
h - step size
y1 - initial value (y(x1) == y1)
When you compile theorem.c as is and run with 5 args, it numerically
solves the equation y'=f(x,y), with a step size of h, over the interval
x=[x1,x2], with the initial condition of y(x1)=y1.
The 'expression' f(x,y), is any function of 'x' and 'y' with the
operators:
+ - * / ^
The symbol '^' is the power operator. Note that it only supports
integer powers. Also note that all expressions are evaluated strictly
left to right. (i.e., parenthesis aren't supported).
Try running the program with the following args:
theorem y 0 1 0.1 1
theorem 1/x 1 2 0.1 0
theorem 'x^2/y+x' 0 1 0.1 6
But wait, there is more! You also get, free of charge, a
reversing filter! Try:
theorem -r 0 0 0 0 < theorem.c > sorter.c
Still not impressed? The author throws in for free, a
sort program! Try:
cc sorter.c -o sorter
ls | sorter
This program is safe for home use as well. The author has
included a safety feature in case you misplace the original
program source:
sorter -r 0 0 0 0 < sorter.c > theorem_bkp.c
And finally, as a special offer to users of this entry,
the author provides a Fibonacci sequence generator! Try:
sorter 0 0 0 0 < theorem.c > fibonacci.c
cc fibonacci.c -o fibonacci
fibonacci 1 1
fibonacci 2 1
Program available 9 track and cartridge cassette. Gensu knife
not included! :-)
When this program was first shown at the 1990 Summer Usenix
conference, it received a standing ovation; a first for
a contest entry.
It should be noted that the 4 trailing args '0 0 0 0', are
required on systems that dump core when NULL is dereferenced.
Selected notes from the author:
Differential equations are solved via the Runge-Kutta method,
which guarantees local error proportional to h^5, and total
error across a finite interval is at most a constant times h^4.
Sorting is accomplished with a standard shell sort.
Note that the sorting and reversing is limited to files with
fewer than 500 lines, each less than 99 characters long.
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.
+107
View File
@@ -0,0 +1,107 @@
char*lie;
double time, me= !0XFACE,
not; int rested, get, out;
main(ly, die) char ly, **die ;{
signed char lotte,
dear; (char)lotte--;
for(get= !me;; not){
1 - out & out ;lie;{
char lotte, my= dear,
**let= !!me *!not+ ++die;
(char*)(lie=
"The gloves are OFF this time, I detest you, snot\n\0sed GEEK!");
do {not= *lie++ & 0xF00L* !me;
#define love (char*)lie -
love 1s *!(not= atoi(let
[get -me?
(char)lotte-
(char)lotte: my- *love -
'I' - *love - 'U' -
'I' - (long) - 4 - 'U' ])- !!
(time =out= 'a'));} while( my - dear
&& 'I'-1l -get- 'a'); break;}}
(char)*lie++;
(char)*lie++, (char)*lie++; hell:0, (char)*lie;
get *out* (short)ly -0-'R'- get- 'a'^rested;
do {auto*eroticism,
that; puts(*( out
- 'c'
-('P'-'S') +die+ -2 ));}while(!"you're at it");
for (*((char*)&lotte)^=
(char)lotte; (love ly) [(char)++lotte+
!!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; }
else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -=
'4' - ('I'-1l); not; for(get=!
get; !out; (char)*lie & 0xD0- !not) return!!
(char)lotte;}
(char)lotte;
do{ not* putchar(lie [out
*!not* !!me +(char)lotte]);
not; for(;!'a';);}while(
love (char*)lie);{
register this; switch( (char)lie
[(char)lotte] -1s *!out) {
char*les, get= 0xFF, my; case' ':
*((char*)&lotte) += 15; !not +(char)*lie*'s';
this +1s+ not; default: 0xF +(char*)lie;}}}
get - !out;
if (not--)
goto hell;
exit( (char)lotte);}
+54
View File
@@ -0,0 +1,54 @@
Best Layout:
Brian Westley (Merlyn LeRoy on usenet)
DigiBoard, Inc.
1026 Blair Ave.
St. Paul, MN 55104
USA
Judges' comments:
usage: westley <number>
If you would rather "Daisy" someone other than Westley, rename
the program as needed. :-)
Read each block of code as if it were a piece of correspondence.
For example, the first block of code would read:
charlie,
doubletime me, OXFACE!
not interested, get out
mainly die, charly, *die*
signed charlotte
The original source had control-L's after each code block. To
make it easier on news readers, we converted each control-L to
a blank line.
Some ANSI compilers will not accept '1s' as a short integer - for
these compilers replace the '1s' with '1'.
Selected notes from the author:
This is a "Picking the Daisy" simulation. Now, instead of mangling a
daisy, simply run this program with the number of petals desired as
the argument.
This is a good counter-example to peoples' complaints that C doesn't
have an "English-like" syntax.
Lint complains about everything - null effect, xxx may be used before
set, statement not reached, return(e) and return. Lint dumps core
on some systems. My personal favorite lint complaint is
"warning: eroticism unused in function main".
Also obviously, (char)lotte and (char*)lie are incompatible types...
Copyright (c) 1990, 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
and remains unaltered. All other uses must receive prior permission in writing
from both Landon Curt Noll and Larry Bassel.