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:
1 parent
28efc67f5d
commit
c0663537cb
1683 files changed
+220064
No files matched your search
Binary file not shown.
+361
@@ -0,0 +1,361 @@
|
||||
#!/bin/make
|
||||
#
|
||||
# 2004 makefile
|
||||
#
|
||||
# Copyright (C) 2004, Landon Curt Noll, Simon Cooper, Peter Seebach
|
||||
# and Leonid A. Broukhis. All Rights Reserved. Permission for personal,
|
||||
# educational or non-profit use is granted provided this copyright and
|
||||
# notice are included in its entirety and remains unaltered. All other
|
||||
# uses must receive prior permission from the contest judges.
|
||||
|
||||
|
||||
# tool locations
|
||||
#
|
||||
SHELL= /bin/sh
|
||||
CP= cp
|
||||
CPP= cpp
|
||||
GUNZIP= gunzip
|
||||
LD= ld
|
||||
MAKE= make
|
||||
RM= rm
|
||||
SED= sed
|
||||
TAR= tar
|
||||
TRUE= true
|
||||
|
||||
|
||||
# Special flags for the gavin entry
|
||||
#
|
||||
# FYI: Older versions of GCC have a bug in -O2 optimization, hence -O1
|
||||
#
|
||||
GAVIN_OPT= -O1
|
||||
GAVIN_FLAGS=\
|
||||
'-DY(m)=*((int*)(m))'\
|
||||
'-DE(f,a,b,c)=((G((*)))(f))(a,b,c)'\
|
||||
'-DM=for(D=0;D<786432;D++)'\
|
||||
'-DZ=int i=0,j=0,h,n,p=393728,s=26739,C,D'\
|
||||
'-DV=0x90200'\
|
||||
'-DK=0'\
|
||||
'-DR=while((C=E(V-8,100,0,0))&3&&(D=E(V-8,96,0,0))|3){'\
|
||||
'-DL(c,d)=E(V+8,100,c,0);R}E(V+8,96,d,0);R}'
|
||||
|
||||
|
||||
# Set X11_LIBDIR to the directory where the X11 library resides
|
||||
#
|
||||
X11_LIBDIR= /usr/X11R6/lib
|
||||
|
||||
|
||||
# optimization
|
||||
#
|
||||
# Most compiles will safely use -O2. Some can use only -O1 or -O.
|
||||
# A few compilers have broken optimizers and thus you may
|
||||
# not want anything.
|
||||
#
|
||||
#OPT=
|
||||
#OPT= -O
|
||||
#OPT= -O1
|
||||
OPT= -O2
|
||||
|
||||
|
||||
# flags for ANSI compiles
|
||||
#
|
||||
# NOTE: Some ANSI compilers make use of -Xa to turn on ANSI mode,
|
||||
# others such as gcc may want -ansi, others (Compaq Tru64 Unix)
|
||||
# want -std1, and others may want nothing at all.
|
||||
# Adjust the CFLAGS line as needed.
|
||||
#
|
||||
# NOTE: Some compilers cannot optimize, or optimize some entries
|
||||
# incorrectly. You might want to turn on -O to see if your
|
||||
# compiler can handle them.
|
||||
#
|
||||
#
|
||||
#CFLAGS= -Xa ${OPT}
|
||||
#CFLAGS= -std1 $(OPT)
|
||||
CFLAGS= -ansi ${OPT}
|
||||
|
||||
|
||||
# ANSI compiler
|
||||
#
|
||||
# Set CC to the name of your ANSI compiler.
|
||||
#
|
||||
# Some entries seem to need gcc. If you have gcc, set
|
||||
# both CC and MAY_NEED_GCC to gcc.
|
||||
#
|
||||
# If you do not have gcc, set CC to the name of your ANSI compiler, and
|
||||
# set MAY_NEED_GCC to either ${CC} (and hope for the best) or to just :
|
||||
# to disable such programs.
|
||||
#
|
||||
CC= cc
|
||||
MAY_NEED_GCC= gcc
|
||||
|
||||
|
||||
# 2004 winners
|
||||
#
|
||||
WINNERS= anonymous arachnid burley gavare gavin hibachi hoyle jdalbec \
|
||||
kopczynski newbern omoikane schnitzi sds vik1 vik2
|
||||
CLEAN= anonymous_clean arachnid_clean burley_clean gavare_clean gavin_clean \
|
||||
hibachi_clean hoyle_clean jdalbec_clean kopczynski_clean \
|
||||
newbern_clean omoikane_clean schnitzi_clean sds_clean vik1_clean \
|
||||
vik2_clean
|
||||
CLOBBER= anonymous_clobber arachnid_clobber burley_clobber gavare_clobber \
|
||||
gavin_clobber hibachi_clobber hoyle_clobber jdalbec_clobber \
|
||||
kopczynski_clobber newbern_clobber omoikane_clobber schnitzi_clobber \
|
||||
sds_clobber vik1_clobber vik2_clobber
|
||||
ALT_NAMES= hoyle.orig kopczynski.orig
|
||||
DATA_FILES= arachnid_files gavin_files hibachi_files kopczynski_files \
|
||||
newbern_files omoikane_files schnitzi_files
|
||||
|
||||
|
||||
# default build
|
||||
#
|
||||
all: ${WINNERS}
|
||||
|
||||
|
||||
# Best use of "Precious" Lines
|
||||
#
|
||||
anonymous: anonymous.c
|
||||
${CC} anonymous.c -o anonymous
|
||||
|
||||
anonymous_clean:
|
||||
${RM} -f anonymous.o
|
||||
|
||||
anonymous_clobber: anonymous_clean
|
||||
${RM} -f anonymous
|
||||
|
||||
|
||||
# Best use of Vision
|
||||
#
|
||||
arachnid: arachnid.c
|
||||
${CC} -o arachnid -DL=LINES -DS=COLS \
|
||||
-DW=mvwaddch\(w,v,u,acs_map\[l\[m\[u arachnid.c -lncurses
|
||||
|
||||
arachnid_clean:
|
||||
${RM} -f arachnid.o
|
||||
|
||||
arachnid_clobber: arachnid_clean
|
||||
${RM} -f arachnid
|
||||
|
||||
arachnid_files: arachnid.info
|
||||
|
||||
|
||||
# Best Calculated Risk
|
||||
#
|
||||
burley: burley.c
|
||||
${CC} -ansi burley.c -o burley
|
||||
|
||||
burley_clean:
|
||||
${RM} -f burley.o
|
||||
|
||||
burley_clobber: burley_clean
|
||||
${RM} -f burley
|
||||
|
||||
|
||||
# Best Use of Light and Spheres
|
||||
#
|
||||
gavare: gavare.c
|
||||
${CC} -O3 gavare.c -o gavare
|
||||
|
||||
gavare_clean:
|
||||
${RM} -f gavare.o
|
||||
|
||||
gavare_clobber: gavare_clean
|
||||
${RM} -f gavare
|
||||
|
||||
|
||||
# Best of Show
|
||||
#
|
||||
gavin: gavin.c
|
||||
${CC} ${GAVIN_OPT} -o gavin ${GAVIN_FLAGS} gavin.c
|
||||
${RM} -f kernel
|
||||
./gavin > kernel
|
||||
${CC} ${GAVIN_OPT} -c ${GAVIN_FLAGS} -DB=_start '-Dputchar(a)=' gavin.c
|
||||
${RM} -f sh
|
||||
${LD} -s -o sh gavin.o
|
||||
${RM} -f vi
|
||||
${CP} sh vi
|
||||
${RM} -f fs.tar
|
||||
${TAR} -cvf fs.tar sh vi gavin.c gavin.hint prim
|
||||
|
||||
gavin_clean:
|
||||
${RM} -f sh vi kernel gavin.o
|
||||
|
||||
gavin_clobber: gavin_clean
|
||||
${RM} -f gavin fs.tar
|
||||
|
||||
gavin_files: boot.b lilo.conf prim gavin_install.txt
|
||||
|
||||
|
||||
# Best Abuse of the Guidelines
|
||||
#
|
||||
hibachi: hibachi.tar.gz
|
||||
${RM} -f hibachi.tar
|
||||
${GUNZIP} < hibachi.tar.gz > hibachi.tar
|
||||
${TAR} -xvf hibachi.tar
|
||||
${RM} -f hibachi.tar
|
||||
(cd hibachi && ${SHELL} ./configure)
|
||||
([ -f hibachi/makefile ] && cd hibachi && $(MAKE) -f makefile || true)
|
||||
|
||||
hibachi_clean:
|
||||
${RM} -f hibachi/hibachi.o hibachi.tar
|
||||
|
||||
hibachi_clobber: hibachi_clean
|
||||
${RM} -rf hibachi
|
||||
|
||||
hibachi_files: hibachi.tar.gz
|
||||
|
||||
|
||||
# Most Functional Output
|
||||
#
|
||||
hoyle: hoyle.c
|
||||
${CC} hoyle.c -o hoyle -lm
|
||||
|
||||
hoyle.orig: hoyle.orig.c
|
||||
${CC} hoyle.orig.c -o hoyle.orig -lm
|
||||
|
||||
hoyle_clean:
|
||||
${RM} -f hoyle.o hoyle.orig.o
|
||||
|
||||
hoyle_clobber: hoyle_clean
|
||||
${RM} -f hoyle hoyle.orig
|
||||
|
||||
|
||||
# Best Abuse of the Periodic Table
|
||||
#
|
||||
jdalbec: jdalbec.c
|
||||
@${RM} -f jdalbec2.c
|
||||
-${CC} -E jdalbec.c > jdalbec2.c
|
||||
@${RM} -f jdalbec3.c
|
||||
${SED} -e 's/ (/(/g' < jdalbec2.c > jdalbec3.c
|
||||
${CC} -ansi jdalbec3.c -o jdalbec
|
||||
|
||||
jdalbec_clean:
|
||||
${RM} -f jdalbec2.c jdalbec3.c jdalbec.o
|
||||
|
||||
jdalbec_clobber: jdalbec_clean
|
||||
${RM} -f jdalbec
|
||||
|
||||
|
||||
# Best one-liner
|
||||
#
|
||||
kopczynski: kopczynski.c
|
||||
${CC} -Dif=while kopczynski.c -o kopczynski
|
||||
|
||||
kopczynski.orig: kopczynski.orig.c
|
||||
${CC} -Dif=while kopczynski.orig.c -o kopczynski.orig
|
||||
|
||||
kopczynski_clean:
|
||||
${RM} -f kopczynski.o kopczynski.orig.o
|
||||
|
||||
kopczynski_clobber: kopczynski_clean
|
||||
${RM} -f kopczynski kopczynski.orig
|
||||
|
||||
kopczynski_files: kopczynski-10 kopczynski-11 kopczynski-8a kopczynski-8b \
|
||||
kopczynski-8c kopczynski-9
|
||||
|
||||
|
||||
# Best Font Engine
|
||||
#
|
||||
newbern: newbern.c
|
||||
${CC} newbern.c -o newbern
|
||||
|
||||
newbern_clean:
|
||||
${RM} -f newbern.o
|
||||
|
||||
newbern_clobber: newbern_clean
|
||||
${RM} -f newbern
|
||||
|
||||
newbern_files: newbern.dat
|
||||
|
||||
|
||||
# Best Utility
|
||||
#
|
||||
omoikane: omoikane.c
|
||||
${CC} -O omoikane.c -o omoikane
|
||||
|
||||
omoikane_clean:
|
||||
${RM} -f omoikane.o
|
||||
|
||||
omoikane_clobber: omoikane_clean
|
||||
${RM} -f omoikane
|
||||
|
||||
omoikane_files: omoikane.info
|
||||
|
||||
|
||||
# Best Non-Use of Curses
|
||||
#
|
||||
schnitzi: schnitzi.c
|
||||
${CC} schnitzi.c -o schnitzi
|
||||
|
||||
schnitzi_clean:
|
||||
${RM} -f schnitzi.o
|
||||
|
||||
schnitzi_clobber: schnitzi_clean
|
||||
${RM} -f schnitzi
|
||||
|
||||
schnitzi_files: schnitzi.inp0 schnitzi.inp1
|
||||
|
||||
|
||||
# Best Abuse of Indentation
|
||||
#
|
||||
sds: sds.c
|
||||
${CC} -o sds sds.c
|
||||
|
||||
sds_clean:
|
||||
${RM} -f sds_encoder.c sds_encoder.o sds.o
|
||||
|
||||
sds_clobber: sds_clean
|
||||
${RM} -f sds sds_encoder
|
||||
|
||||
|
||||
# Best X11 Game
|
||||
#
|
||||
vik1: vik1.c
|
||||
${CC} -ansi -O2 -o vik1 vik1.c -L${X11_LIBDIR} -lX11
|
||||
|
||||
vik1_clean:
|
||||
${RM} -f vik1.o
|
||||
|
||||
vik1_clobber: vik1_clean
|
||||
${RM} -f vik1
|
||||
|
||||
|
||||
# Best Abuse of CPP
|
||||
#
|
||||
vik2: vik2.c
|
||||
@${RM} -f vik2_1.c
|
||||
${CC} -E '-DSTOP=_5' '-DFNAME="vik2_1.c"' vik2.c > vik2_1.c
|
||||
@${RM} -f vik2_2.c
|
||||
${CC} -E vik2_1.c > vik2_2.c
|
||||
${CC} -O vik2_2.c -o vik2
|
||||
|
||||
vik2_clean:
|
||||
${RM} -f vik2_1.c vik2_2.c vik2.o
|
||||
|
||||
vik2_clobber: vik2_clean
|
||||
${RM} -f vik2
|
||||
|
||||
|
||||
# utility rules
|
||||
#
|
||||
everything: ${WINNERS} ${ALT_NAMES} ${DATA_FILES}
|
||||
|
||||
love:
|
||||
@echo 'not war?'
|
||||
|
||||
haste:
|
||||
$(MAKE) waste
|
||||
|
||||
waste:
|
||||
@echo 'waste'
|
||||
|
||||
clean: ${CLEAN}
|
||||
${RM} -f a.out core
|
||||
|
||||
clobber: ${CLOBBER}
|
||||
${RM} -f ${WINNERS}
|
||||
${RM} -f ${ALT_NAMES}
|
||||
|
||||
nuke: clobber
|
||||
@${TRUE}
|
||||
|
||||
install: all
|
||||
${CAT} ${WINNERS} ${ALT_NAMES} > /dev/null
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
2004 marked the "The Seventeenth International Obfuscated C Code Contest"
|
||||
|
||||
Copyright (C) 2001-2004, Landon Curt Noll, Simon Cooper, Peter Seebach
|
||||
and Leonid A. Broukhis. All Rights Reserved. Permission for personal,
|
||||
educational or non-profit use is granted provided this copyright and
|
||||
notice are included in its entirety and remains unaltered. All other
|
||||
uses must receive prior permission from the contest judges.
|
||||
|
||||
|
||||
Standard IOCCC stuff
|
||||
--------------------
|
||||
|
||||
The IOCCC has a web site and now has a number of international mirrors.
|
||||
The primary site can be found at,
|
||||
|
||||
http://www.ioccc.org/
|
||||
|
||||
Use make to compile entries. It is possible that on non-Un*x / non-Linux
|
||||
systems the makefile needs to be changed. See the Makefile for details.
|
||||
|
||||
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
|
||||
spoilers - this year we included most of the information included
|
||||
by the submitters.
|
||||
|
||||
Read over the makefile for compile/build issues. Your system may
|
||||
require certain changes (add or remove a library, add or remove a
|
||||
#define).
|
||||
|
||||
Some ANSI C compilers are not quite as good as they should be. If
|
||||
yours is lacking, you may need to compile using gcc instead of your
|
||||
local compiler.
|
||||
|
||||
|
||||
Remarks on some of the entries
|
||||
------------------------------
|
||||
|
||||
There were some outstanding entries that did not win. Unfortunately
|
||||
some very good entries lost because they:
|
||||
|
||||
+ depended too much on non-portable side effects in expressions;
|
||||
+ depended too much on a particular byte order;
|
||||
+ required the use of a special script, data file or pseudo-machine
|
||||
language that was not supplied with the entry.
|
||||
|
||||
We hope the authors of some of those entries will fix and re-submit
|
||||
them for the next IOCCC.
|
||||
|
||||
We believe you will be impressed with this year's winners. The Best
|
||||
of Show is a fine example of obfuscation. But don't ignore the other
|
||||
winners! There are games, utilities, programs that output images and
|
||||
a one-liner that is incredibly compact for what it can do.
|
||||
|
||||
The Best Abuse of the Guidelines is technically allowed by the rules.
|
||||
This year we allowed it due to the functionality of the program. This
|
||||
entry is one of the easiest to read! Don't assume you can win using
|
||||
similar techniques next time ... :-)
|
||||
|
||||
This year a single person won two awards! We also had repeat winners
|
||||
with their 6th, 4th and 2nd winning entries this year! (Please note that
|
||||
judging is done completely anonymously. Be warned that we may disqualify
|
||||
entries that reveal the identity of the submitter).
|
||||
|
||||
|
||||
Final Comments
|
||||
--------------
|
||||
|
||||
Please feel free to send us comments and suggestions about the
|
||||
competition, this README or anything else that you would like to see in
|
||||
future contests.
|
||||
|
||||
If you use, distribute or publish these entries in some way, please drop
|
||||
us a line. We enjoy seeing who, where and how the contest is used.
|
||||
|
||||
If you have problems with any of the entries, AND YOU HAVE A FIX, please
|
||||
send us the fix (patch file or the entire changed file).
|
||||
|
||||
For the latest information on how to contact the IOCCC Judges please visit
|
||||
|
||||
http://www.ioccc.org/contact.html
|
||||
|
||||
Watch:
|
||||
|
||||
http://www.ioccc.org/
|
||||
|
||||
for news of the next contest.
|
||||
@@ -0,0 +1,47 @@
|
||||
#include\
|
||||
<stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define w "Hk~HdA=Jk|Jk~LSyL[{M[wMcxNksNss:"
|
||||
#define r"Ht@H|@=HdJHtJHdYHtY:HtFHtF=JDBIl"\
|
||||
"DJTEJDFIlMIlM:HdMHdM=I|KIlMJTOJDOIlWITY:8Y"
|
||||
#define S"IT@I\\@=HdHHtGH|KILJJDIJDH:H|KID"\
|
||||
"K=HdQHtPH|TIDRJDRJDQ:JC?JK?=JDRJLRI|UItU:8T"
|
||||
#define _(i,j)L[i=2*T[j,O[i=O[j-R[j,T[i=2*\
|
||||
R[j-5*T[j+4*O[j-L[j,R[i=3*T[j-R[j-3*O[j+L[j,
|
||||
#define t"IS?I\\@=HdGHtGIDJILIJDIItHJTFJDF:8J"
|
||||
|
||||
#define y yy(4),yy(5), yy(6),yy(7)
|
||||
#define yy( i)R[i]=T[i],T[i ] =O[i],O[i]=L [i]
|
||||
#define Y _(0 ], 4] )_ (1 ], 5] )_ (2 ], 6] )_ (3 ], 7] )_=1
|
||||
#define v(i)( (( R[ i ] * _ + T [ i ]) * _ + O [ i ]) * _ + L [ i ]) *2
|
||||
double b = 32 ,l ,k ,o ,B ,_ ; int Q , s , V , R [8 ], T[ 8] ,O [8 ], L[ 8] ;
|
||||
#define q( Q,R ) R= *X ++ % 64 *8 ,R |= *X /8 &7 ,Q=*X++%8,Q=Q*64+*X++%64-256,
|
||||
# define p "G\\QG\\P=GLPGTPGdMGdNGtOGlOG" "dSGdRGDPGLPG\\LG\\LHtGHtH:"
|
||||
# define W "Hs?H{?=HdGH|FI\\II\\GJlHJ" "lFL\\DLTCMlAM\\@Ns}Nk|:8G"
|
||||
# define U "EDGEDH=EtCElDH{~H|AJk}" "Jk?LSzL[|M[wMcxNksNst:"
|
||||
# define u "Hs?H|@=HdFHtEI" "\\HI\\FJLHJTD:8H"
|
||||
char * x ,*X , ( * i )[ 640],z[3]="4_",
|
||||
*Z = "4,8O4.8O4G" r U "4M"u S"4R"u t"4S8CHdDH|E=HtAIDAIt@IlAJTCJDCIlKI\\K:8K"U
|
||||
"4TDdWDdW=D\\UD\\VF\\FFdHGtCGtEIDBIDDIlBIdDJT@JLC:8D"t"4UGDNG\\L=GDJGLKHL\
|
||||
FHLGHtEHtE:"p"4ZFDTFLT=G|EGlHITBH|DIlDIdE:HtMH|M=JDBJLDKLAKDALDFKtFKdMK\
|
||||
\\LJTOJ\\NJTMJTM:8M4aGtFGlG=G|HG|H:G\\IG\\J=G|IG|I:GdKGlL=G|JG|J:4b"W
|
||||
S"4d"W t t"4g"r w"4iGlIGlK=G|JG|J:4kHl@Ht@=HdDHtCHdPH|P:HdDHdD=It\
|
||||
BIlDJTEJDFIdNI\\N:8N"w"4lID@IL@=HlIH|FHlPH|NHt^H|^:H|MH|N=J\\D\
|
||||
J\\GK\\OKTOKDXJtXItZI|YIlWI|V:8^4mHLGH\\G=HLVH\\V:4n" u t t
|
||||
"4p"W"IT@I\\@=HdHHtGIDKILIJLGJLG:JK?JK?=JDGJLGI|MJDL:8M4\
|
||||
rHt@H|@=HtDH|BJdLJTH:ITEI\\E=ILPILNNtCNlB:8N4t"W t"4u"
|
||||
p"4zI[?Il@=HlHH|HIDLILIJDII|HKDAJ|A:JtCJtC=JdLJtJL\
|
||||
THLdFNk|Nc|\
|
||||
:8K"; main (
|
||||
int C,char** A) {for(x=A[1],i=calloc(strlen(x)+2,163840);
|
||||
C-1;C<3?Q=_= 0,(z[1]=*x++)?((*x++==104?z[1]^=32:--x), X =
|
||||
strstr(Z,z)) &&(X+=C++):(printf("P2 %d 320 4 ",V=b/2+32),
|
||||
V*=2,s=Q=0,C =4):C<4?Q-->0?i[(int)((l+=o)+b)][(int)(k+=B)
|
||||
]=1:_?_-=.5/ 256,o=(v(2)-(l=v(0)))/(Q=16),B=(v(3)-(k=v(1)
|
||||
))/Q:*X>60?y ,q(L[4],L[5])q(L[6],L[7])*X-61||(++X,y,y,y),
|
||||
Y:*X>57?++X, y,Y:*X >54?++X,b+=*X++%64*4:--C:printf("%d "
|
||||
,i[Q][s]+i[Q ][s+1]+i[Q+1][s]+i[Q+1][s+1])&&(Q+=2)<V||(Q=
|
||||
0,s+=2)<640
|
||||
||(C=1));}
|
||||
@@ -0,0 +1,65 @@
|
||||
Best use of "Precious" Lines:
|
||||
|
||||
The author wishes to remain anonymous
|
||||
Singapore
|
||||
|
||||
http://bicoherent.topcities.com/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make anonymous
|
||||
|
||||
Try:
|
||||
|
||||
./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \
|
||||
ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >anonymous.pgm
|
||||
|
||||
Then view the output using your favourite "pgm" viewer. If you
|
||||
don't have a "pgm" viewer then we suggest the "netpbm" toolkit
|
||||
(http://netpbm.sourceforge.net/) to convert the image to a
|
||||
graphics format that you can view - most graphical Web browsers
|
||||
can display PNG or JPEG images.
|
||||
|
||||
p.s. Frodo lives!
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This program takes a single command line argument, transcribes the
|
||||
argument text into Tolkien's Elvish letters, and writes the
|
||||
transcription to standard output as a portable graymap (PGM) file.
|
||||
|
||||
The specific transcription mode is the Black Speech Tengwar mode, as
|
||||
used in the inscription on the One Ring. The program handles the
|
||||
following diagraphs:
|
||||
|
||||
- "gh", "sh", "th": the corresponding tengwar are output for these
|
||||
specific sounds
|
||||
- "mh" denotes the full tengwa for [m]; "m" by itself means a
|
||||
horizontal bar above the next letter
|
||||
- "rh" denotes the [r\] tengwa
|
||||
- "uh" denotes the tehta for long vowel [u:]
|
||||
- "zh" selects the up-reaching tengwa for [z], while "z" selects the
|
||||
down-reaching one
|
||||
|
||||
Punctuation marks other than commas and periods are ignored, as are
|
||||
whitespace characters. In addition, the argument text must be entirely
|
||||
in lower case.
|
||||
|
||||
The following command thus writes a rendering of the Ring inscription to
|
||||
the file out.pgm:
|
||||
|
||||
./anonymous "ash nazg durhbatuluhk, ash nazg gimbatul, \
|
||||
ash nazg thrakatuluhk, agh burzhumh-ishi krimpatul." >anonymous.pgm
|
||||
|
||||
The source code assumes the ASCII character set; also, due to space
|
||||
constraints, the program uses rather inefficient algorithms, so it may
|
||||
waste a lot of time and space even when rendering moderately long
|
||||
strings.
|
||||
|
||||
The code contains a vector font which was derived by toying with Harri
|
||||
Pera:la:'s Tengwar Cursive font. Currently, only the glyphs used in the
|
||||
Ring inscription are included in the font.
|
||||
@@ -0,0 +1,51 @@
|
||||
#include <ncurses.h>/*****************************************************/
|
||||
int m[256 ] [ 256 ],a
|
||||
,b ;;; ;;; WINDOW*w; char*l="" "\176qxl" "q" "q" "k" "w\
|
||||
xm" "x" "t" "j" "v" "u" "n" ,Q[
|
||||
]= "Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/** *** */"t\040\t";c(
|
||||
int u , int v){ v?m [u] [v-
|
||||
1] |=2,m[u][v-1] & 48?W][v-1 ] & 15]]):0:0;u?m[u -1][v]|=1 ,m[
|
||||
u- 1][ v]& 48? W-1 ][v ]&
|
||||
15] ]):0:0;v< 255 ?m[ u][v+1]|=8,m[u][v+1]& 48? W][ v+1]&15]]
|
||||
):0 :0; u < 255 ?m[ u+1 ][v ]|=
|
||||
4,m[u+1][ v]&48?W+1][v]&15]]):0:0;W][ v]& 15] ]);}cu(char*q){ return
|
||||
*q ?cu (q+ 1)& 1?q [0] ++:
|
||||
q[0 ]-- :1; }d( int u , int/**/v, int/**/x, int y){ int
|
||||
Y=y -v, X=x -u; int S,s ;Y< 0?Y =-Y ,s,
|
||||
s=- 1:( s=1);X<0?X=-X,S =-1 :(S= 1); Y<<= 1;X<<=1; if(X>Y){
|
||||
int f=Y -(X >>1 );; while(u!= x){
|
||||
f>= 0?v+=s,f-=X:0;u +=S ;f+= Y;m[u][v]|=32;mvwaddch(w,v ,u, m[u
|
||||
][ v]& 64? 60: 46) ;if (m[ u][
|
||||
v]&16){c(u,v);; ;;; ;;; return;}} }else{int f=X -(Y>>1);; while
|
||||
(v !=y ){f >=0 ?u +=S, f-= Y:0
|
||||
;v +=s ;f+=X;m[u][v]|= 32;mvwaddch(w,v ,u,m[u][v]&64?60:46);if(m[u
|
||||
][ v]& 16) {c( u,v );
|
||||
; return;;;}}}}Z( int/**/a, int b){ }e( int/**/y,int/**/ x){
|
||||
int i ; for (i= a;i <=a
|
||||
+S;i++)d(y,x,i,b),d(y,x,i,b+L);for(i=b;i<=b+L;i++)d(y,x,a,i),d(y,x,a+ S,i
|
||||
); ;;; ;;; ;;; ;;; ;
|
||||
mvwaddch(w,x,y,64); ;;; ;;; ;;; prefresh( w,b,a,0,0 ,L- 1,S-1
|
||||
);} main( int V , char *C[
|
||||
] ){FILE*f= fopen(V==1?"arachnid.c"/**/ :C[ 1],"r");int/**/x,y,c,
|
||||
v=0 ;;; initscr (); Z(Z (raw
|
||||
() ,Z( curs_set(0),Z(1 ,noecho()))),keypad( stdscr,TRUE));w =newpad
|
||||
( 300, 300 ) ; for (x= 255 ; x >=0 ;x--
|
||||
) for (y= 255 ;y>=0;y-- )m[ x][ y]= 0;x=y=0;refresh( );while
|
||||
( (c= fgetc (f) )+1) {if(
|
||||
0||c==10|| x== 256){x=0;y++;if(y==256 )break;;} else{m[x][y]=(c ==
|
||||
'~' ?64 : c ==32 ?0: 16) ;;x ++;
|
||||
}}for(x=0 ;x< 256;x++)m [x][0]=16 ,m[ x][ 255]=16;for(y=0
|
||||
;y< 256 ; y ++) m[0 ][y ] = 16,
|
||||
m[255][y] =16 ;a=b=c=0; x=y =1; do{v++;mvwaddch (w, y,x ,m[
|
||||
x][ y]& 32? m[x ][y ] & 16?
|
||||
0| acs_map[l[m[x][y]&15]]:46 : 32);c==0163&&!(m[x][y+1]&16)?y++: 0;c
|
||||
== 119 &&! (m[ x][
|
||||
y- 1]& 16) ?y--:0;;c ==97 &&!(m[x-1][y]&16)?x--:0;c==100&&!(m[x+1
|
||||
][ y]& 16) ? x ++:0 ;if( c==
|
||||
3- 1+1 ){endwin( );; return(0) ;}x -a<5?a>S- 5?a-=S-5:(a=0):
|
||||
0;x -a> S-5?a<255 -S* 2?a +=S
|
||||
-5:(a=256-S):0; y-b<5?b>L-5?b-=L-5:(b =0) :0; y-b>L-5?b<255-L *2?
|
||||
b+= L-5 :(b =256
|
||||
-L) :0;e(x,y);if(m[x][y]&64)break;}while((c=getch())!=-1);endwin();cu(Q);
|
||||
printf(Q,v);}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
Best use of Vision:
|
||||
|
||||
Nick Johnson
|
||||
25 Harvey Tce
|
||||
Richmond
|
||||
Christchurch
|
||||
New Zealand
|
||||
|
||||
http://www.notdot.net/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make arachnid
|
||||
|
||||
Try:
|
||||
|
||||
./arachnid
|
||||
./arachnid arachnid.info
|
||||
|
||||
The fun part comes when you realize that the maze scrolls. The overall
|
||||
visual effect is quite pleasing (at least on some displays), and, well,
|
||||
it's a lot of fun.
|
||||
|
||||
Navigation is through the use of the "wasd" inverted-T formation on
|
||||
Qwerty keyboards. Rogue players, vi users, and Dvorak typists are
|
||||
invited to get lost!
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This program accepts ASCII formatted mazes as input, and renders
|
||||
them onscreen for the user to explore, complete with Line Of Sight
|
||||
- you cannot see parts of the maze your avatar (the '@') could not
|
||||
have seen.
|
||||
|
||||
The maze files will be interpreted with spaces ' ' as gaps, tilde
|
||||
'~' symbols (if any) as exits (which get represented as a NetHack
|
||||
style '<' once loaded), and any other characters as walls.
|
||||
|
||||
Feed the program its own source for a default maze. Running it with
|
||||
no command line parameters will do this. In a nice symmetry, the
|
||||
character constant '~' that recognises exits to input mazes itself
|
||||
forms the exit to the default maze. Another maze, 'maze1' has also
|
||||
been provided. This maze is 255x255, about the largest maze supported,
|
||||
for the particularaly insane maze explorers out there.
|
||||
|
||||
Usage:
|
||||
./prog.c [mazefile]
|
||||
|
||||
You can explore the maze using the w,a,s, and d keys.
|
||||
|
||||
@@ -0,0 +1,256 @@
|
||||
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + + + + +-+ + + +-+-+ + +-+ + +-+-+ + +-+ + + + +-+ + + +-+-+-+ +-+-+-+-+ + +-+ + + + +-+-+-+ + +-+-+ +-+ + + + + + +-+ +-+-+-+ + + +-+-+-+-+-+ + +-+-+-+-+ + + +-+ + + + +-+ +-+-+-+ + +-+-+ +-+ + + + +-+-+ +-+ + + +-+ +-+-+ + +-+ + + + +-+ + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ +-+ + + +-+-+ + +-+ + + +-+ + +-+-+ + + + +-+ +-+-+-+-+ + +-+ +-+-+ + +-+ +-+-+-+ + + + +-+-+ + +-+ +-+ + +-+ +-+-+-+ +-+ +-+-+ + +-+-+-+-+-+-+-+-+-+ + + + +-+ +-+-+-+ +-+ + + + +-+ + + + + + + +-+-+ +-+ +-+ + + +-+ + +-+-+ +-+-+ +-+-+-+-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+ + +-+ + + + + + + + +-+-+ + +-+ +-+-+ + + +-+ +-+-+ + +-+-+-+ +-+-+-+ + + + + +-+-+-+-+-+ +-+-+ + + + +-+ +-+ + + + +-+-+ + +-+ + +-+-+ + +-+-+-+ +-+ +-+-+ +-+ + +-+ +-+-+ +-+-+ + +-+-+ +-+ + + +-+-+-+-+-+-+ + + +-+-+-+ +-+ +-+-+ + +-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ +-+ + + +-+-+ + + + + +-+-+ + + +-+-+ + + + +-+-+-+-+ +-+-+ + + +-+ +-+ + + + + +-+ +-+ + +-+-+ + +-+-+ + + +-+ +-+-+ +-+ +-+-+-+ +-+-+ +-+-+-+-+ + +-+ +-+-+ +-+ + +-+-+-+-+-+-+-+ + + + + + + +-+-+-+ +-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+-+-+-+-+ +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + +-+-+ +-+-+ + +-+ + + +-+ + + + + +-+ +-+-+-+-+-+ +-+-+-+-+ + + +-+-+-+ + +-+ + +-+ + + +-+-+ +-+ +-+ + + + + + +-+-+ + +-+-+ +-+-+ +-+-+-+-+-+-+ + + + + +-+ +-+-+-+ +-+ + + + +-+-+ + + + + + +-+ + + + + + +-+ + + + +-+-+-+-+ +-+-+-+-+-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ + + +-+ +-+-+ + +-+-+-+ + +-+-+ +-+-+-+ + +-+ + + + + + + +-+-+-+ + + +-+ +-+-+-+-+-+-+ + + +-+ + + +-+ + +-+-+ + + + +-+-+-+-+ + +-+-+ +-+-+-+ + +-+ + + + + +-+-+ + + +-+-+-+-+ + +-+ + + + +-+ + +-+ +-+ + + +-+ + +-+ +-+-+ + + + + + +-+-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+ +-+-+ + + +-+-+ + +-+ + +-+-+-+ +-+-+ + + + +-+-+-+-+ +-+ + + +-+-+-+-+ +-+-+ + +-+ +-+-+ + +-+-+-+-+-+ +-+ +-+ + +-+-+-+ + +-+-+-+-+-+ +-+-+-+-+ +-+ + +-+-+ +-+-+-+-+-+-+-+ +-+-+ +-+-+-+ + + +-+-+-+ + +-+-+ + +-+-+-+-+ + +-+ + + + +-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + +-+-+ + +-+-+ + +-+ + +-+-+-+-+-+-+ +-+ + + + + +-+-+-+-+ + +-+-+-+ + +-+-+ + +-+-+ +-+ +-+ + + +-+-+-+ +-+ + +-+-+ + + + +-+-+-+-+-+-+-+-+ +-+-+ + + +-+ + +-+ +-+-+-+-+ + + +-+ + +-+-+ + + +-+-+ + + +-+-+ + + +-+ + +-+ +-+-+ +-+-+ +-+ + + +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+-+ +-+-+-+ + + +-+-+-+-+ + +-+ +-+ + + +-+-+ + + + +-+-+-+ +-+ +-+-+ + +-+ +-+-+ + +-+ +-+ +-+-+ + +-+-+-+ +-+-+-+ +-+-+-+-+ +-+ + + +-+-+ +-+ + + + +-+ +-+ + +-+-+ + +-+ + +-+ +-+-+ + +-+ +-+-+ +-+-+-+ + +-+ + +-+-+-+ +-+-+ + + +-+-+ + +-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ + +-+ +-+ + +-+-+ +-+ +-+-+ +-+ + + + +-+ +-+-+ +-+ +-+-+ + + +-+ + + + +-+ + +-+ +-+ +-+ +-+ +-+-+-+ + +-+-+-+-+ + + + + + + + + + +-+-+-+ + + + +-+ + +-+ +-+ +-+-+ + + +-+ +-+-+ + + +-+-+ + +-+-+ +-+ +-+ + + +-+-+ + +-+-+-+ + +-+-+ +-+-+-+-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + +-+-+-+ +-+-+ + + + +-+ +-+ + +-+-+ +-+ +-+ +-+ +-+-+ +-+-+-+-+-+-+ + +-+ +-+-+ + + + +-+ +-+ +-+-+-+-+-+ + +-+-+ +-+-+ + + +-+ +-+ + +-+ + +-+ +-+ +-+-+-+-+-+-+ +-+ +-+-+ + + +-+-+ + + +-+ +-+ + + + +-+-+ +-+-+ +-+-+ + +-+-+ + + + + + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+ +-+-+-+-+ +-+ +-+-+-+ +-+-+-+ + + +-+ + +-+-+ +-+-+-+-+ +-+ + + +-+-+-+ + + + +-+ +-+-+-+ +-+ + + + +-+-+-+ + +-+ + + +-+ + + +-+ +-+-+-+-+-+ +-+ +-+-+-+-+-+ + +-+-+-+ + + +-+-+ +-+-+ +-+ +-+-+-+-+-+-+ +-+-+-+-+-+ + +-+-+ + + + + + +-+ + +-+ +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + +-+-+-+-+-+ +-+ +-+ + + +-+ +-+-+ + +-+-+-+-+-+ + +-+-+-+ +-+-+ + + + +-+ +-+-+ +-+-+ +-+-+ +-+ + +-+ + + +-+ + +-+-+-+-+-+-+ +-+ +-+ + + +-+ + + +-+-+ + + +-+-+-+ + +-+-+-+-+ +-+ + + + + + + +-+-+-+-+-+ +-+ + + + + + +-+-+-+ + + +-+ + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+ + + + + +-+ + + + + +-+ +-+-+-+-+ + +-+-+-+ + +-+-+ + +-+-+ +-+-+-+ +-+-+-+-+ + + + + + +-+ + + + + + +-+-+ + + + +-+-+-+ + +-+ +-+ + + +-+ + +-+-+ + +-+ + +-+-+ + +-+ + +-+-+-+ +-+ + + + +-+-+-+-+ + +-+-+ + + +-+-+-+-+ +-+-+-+-+-+ + + + + +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+ +-+-+ +-+ + +-+-+ +-+-+ + +-+-+-+-+-+-+ + + +-+ +-+-+ +-+ +-+-+ +-+-+ +-+ +-+-+-+-+-+ + + + +-+ +-+-+-+-+ + +-+-+ + +-+-+-+-+-+ +-+-+ + +-+ +-+-+ + + +-+-+ +-+ +-+-+ + + + + +-+ + + +-+-+-+-+ +-+-+-+ +-+ +-+-+-+ +-+-+-+ +-+ + + + +-+ + +-+ + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+ + + + +-+ + +-+-+ + +-+-+ + + +-+-+-+-+-+-+ +-+ + +-+ +-+-+ +-+-+ +-+ +-+-+-+ + +-+-+-+-+-+ + +-+ +-+-+-+ + +-+-+-+-+ + + +-+ +-+ + + + + +-+ + + + + + + + +-+ + + + + + +-+ +-+-+ + + + + +-+-+-+ +-+-+-+ + +-+-+-+ +-+ +-+-+-+-+ + +-+ + +-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + + + +-+ +-+-+ +-+ + + + +-+-+-+-+ + +-+-+-+-+ + + +-+-+ +-+-+ + +-+-+-+ + +-+-+ + + +-+ + +-+ + +-+ +-+ +-+-+ +-+-+ + + +-+ + + +-+-+-+-+-+ + + + + + + + + + + +-+-+-+-+-+ +-+ + + + + + + + +-+-+-+ +-+-+-+ + + + +-+ +-+ +-+-+ +-+-+ + + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ + +-+-+-+-+-+-+ + +-+ +-+-+ + + + + +-+-+-+ + + + + +-+-+ + + + +-+-+-+-+-+-+ + + + + +-+ + +-+ + + + + +-+ +-+ + +-+ + + + +-+ +-+-+-+ + +-+-+ + +-+ +-+-+ + +-+-+-+-+ + + + + +-+ + +-+-+ +-+ +-+-+ + +-+ +-+-+ + + +-+-+ + +-+ + + +-+-+-+-+ +-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+ + + + + + +-+ +-+-+ + + + +-+-+ +-+-+-+ + +-+ + + + + +-+-+-+-+-+ + + + + + +-+-+-+-+-+ + + +-+ +-+-+ + +-+-+ + +-+-+-+ + + +-+ + + +-+ +-+-+ +-+ + + +-+ + +-+-+-+ + + + + + +-+-+-+-+ +-+-+ + +-+ + + +-+ + +-+ + + +-+-+-+-+-+ + + + +-+ +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ + + + +-+ +-+-+-+ + + + +-+ +-+-+-+ +-+ +-+ +-+-+ +-+ + + +-+-+-+-+-+-+-+ +-+-+ +-+ + + + +-+-+-+-+-+-+ +-+-+ + + + + + +-+ + + +-+ + + +-+ + + + + + +-+ +-+ + +-+-+-+ +-+-+-+ + +-+-+-+ + + + + +-+-+-+-+-+ +-+ +-+ + + +-+-+ + + +-+-+ + +-+ +-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + + +-+ + + +-+-+ +-+ + + +-+ +-+ +-+ + + + + + +-+ +-+-+ + + +-+ + + + + +-+-+-+-+ + + + +-+ + + +-+-+-+-+-+ + + +-+ +-+-+-+ +-+-+-+-+-+ + + + +-+ +-+-+-+ +-+ + +-+ + + + +-+-+-+ + + + + +-+-+-+-+ +-+ + +-+-+-+-+ +-+ +-+ +-+-+-+-+ + +-+ + +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ + + +-+-+ + + +-+ +-+-+-+-+ + + +-+ + + + + + +-+-+ + + + +-+-+-+-+ + +-+ +-+ + +-+ +-+-+-+-+-+-+ + +-+-+-+-+-+-+ +-+ +-+ + + +-+ + +-+-+-+ + + + + +-+-+-+ +-+-+-+-+-+-+ + + + + + +-+ +-+-+-+-+ +-+ +-+ + + + + +-+ +-+ + + +-+-+-+-+-+-+-+-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + +-+-+ + + + + +-+-+ +-+-+-+-+-+ +-+-+-+ +-+-+ + + + +-+ +-+-+-+ + +-+-+ + +-+ + +-+-+ +-+ + +-+-+ + +-+ + + + +-+-+ + +-+ +-+-+-+ +-+-+ +-+-+-+-+-+-+-+ + +-+ + +-+ + +-+ + + +-+-+ + + + +-+-+ + +-+-+-+ +-+-+ + +-+ + +-+-+ + +-+ +-+ +-+ + + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + +-+-+-+ + +-+ +-+-+ + + +-+-+ + + +-+ + + + +-+-+-+ + + +-+ + +-+ + + + +-+-+ + + +-+ +-+-+ +-+ + + +-+ + + + + +-+ + + + +-+-+-+ + +-+ + + + + +-+ + + + + +-+ + + + + + +-+-+ + + + +-+-+-+-+ +-+-+-+-+ + + + + + +-+-+ + + + + + +-+ + +-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ + +-+ +-+-+ + + + + +-+-+ + + +-+ + +-+ +-+ + + + +-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+ + +-+ + +-+ + + + + + + + +-+-+ + +-+ + +-+ + +-+ + +-+-+ + +-+ +-+-+-+ + +-+-+-+-+-+ +-+ +-+-+-+ +-+-+-+-+ + + +-+-+ + +-+-+-+-+ + + +-+-+-+-+-+-+-+-+-+ + +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+-+-+ + +-+ +-+ +-+ + + + + +-+-+ + + +-+-+-+-+ + +-+ + + + +-+-+ + +-+-+ + +-+-+ +-+-+-+-+-+ +-+ +-+-+-+-+-+-+ + +-+-+-+ + + +-+ +-+ + +-+ + + +-+-+-+-+-+-+ + + + + +-+ +-+-+-+ + + + +-+-+-+ + +-+ + +-+-+-+-+ +-+-+ + + + + +-+-+ +-+-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+ + + + + +-+ +-+ + + + +-+ +-+ + +-+-+-+ +-+ + +-+ + + + +-+ + +-+ + +-+-+-+-+ + +-+-+-+ + + +-+ +-+-+-+ + + +-+ + +-+ + +-+-+-+ +-+ +-+ + +-+-+ + +-+ + +-+-+ +-+ +-+ + +-+ +-+ + + + +-+ + + + + +-+-+-+ + + + + +-+-+ +-+-+-+-+-+-+ + +-+ +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + +-+-+-+ + +-+ + +-+-+-+ + + +-+-+ +-+ + + +-+ +-+-+-+-+-+ +-+-+ +-+ + + + + + +-+ + + + + +-+-+-+ + +-+-+-+ + +-+-+-+-+ +-+ +-+ + +-+-+-+ + + +-+-+-+ + + + +-+-+-+ +-+-+ + + +-+ + +-+ +-+ +-+-+ +-+ + +-+ +-+-+-+-+ +-+ + +-+-+-+-+-+ + +-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+ + + +-+ +-+-+ + +-+ + + + + +-+-+ + + +-+ + +-+ + + +-+ + +-+-+-+ + +-+-+ +-+ + +-+-+ + + + + +-+-+ + +-+-+-+ + +-+-+-+ +-+ + +-+ + + + +-+ +-+-+-+-+-+-+ +-+ + + +-+-+-+-+-+ +-+-+-+ + +-+ +-+-+ + +-+ + +-+-+-+ +-+ +-+-+ +-+-+-+-+-+-+-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+ + +-+ +-+ +-+-+-+-+-+-+ +-+-+ + +-+ +-+ +-+ + + + + +-+ +-+-+ + +-+-+-+-+ + + + +-+-+ +-+-+-+ +-+-+-+ +-+-+-+ + +-+-+-+-+-+-+ +-+ + +-+-+ + + +-+ + + +-+-+-+-+-+-+ + + +-+-+ +-+-+ +-+ + +-+-+ + + + + + +-+-+ +-+-+-+ +-+ + +-+ + +-+ + +-+-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+ + + +-+-+-+-+ +-+ +-+-+-+-+-+-+-+ + + + + + + +-+ + + + +-+-+-+ + + + + + + +-+-+ +-+ + +-+-+-+-+-+ + +-+-+-+ +-+ + +-+ + + +-+ + + + +-+-+-+-+-+-+ + +-+ + +-+ +-+-+ + + +-+-+-+-+-+-+ + + + +-+-+-+ + + + + + + +-+ + +-+ + + + +-+ +-+ + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+ +-+-+-+-+ + + +-+ + + +-+-+ + + + +-+ + +-+-+ + +-+-+-+-+ + + + + + +-+-+-+-+-+-+ +-+ + +-+-+ + +-+ + +-+-+-+-+-+-+-+ + +-+-+-+-+-+ +-+ +-+-+ +-+ + +-+-+ + +-+-+ + + + + + +-+ +-+ + +-+-+ + + + + + +-+ + + + +-+-+-+ +-+-+-+-+-+ + + + + + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ +-+-+ +-+ +-+-+ +-+-+-+-+-+ + +-+-+ +-+-+-+ + + + +-+-+ + + +-+ + + + + + + +-+-+ + + +-+-+ + +-+ + +-+-+-+ +-+-+-+-+-+ +-+-+ + + + + +-+-+-+ + +-+ +-+-+-+ + + + + +-+ +-+-+-+-+ +-+ +-+-+-+-+ +-+-+ +-+-+ + +-+ + +-+ + +-+ +-+-+ + +-+ + +-+-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+ + + + +-+ +-+ + +-+-+ + +-+-+ + + + + + +-+-+-+ + + +-+ +-+-+-+-+-+-+ + + +-+-+ +-+-+ + +-+ + + + + + +-+-+-+ + + +-+-+-+-+ + + + + + + +-+ + +-+ + +-+-+ +-+-+-+-+-+ +-+-+ +-+-+ + + +-+ +-+-+ + + + +-+-+ +-+-+-+ + + +-+ + + + + + + + + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ +-+-+-+-+ + + +-+-+ + + +-+ +-+-+ + +-+ +-+-+ + +-+-+-+ +-+-+ + +-+-+ +-+-+ + + + + + + +-+ + + +-+ + +-+-+-+ + +-+-+ +-+ + +-+-+ + +-+-+-+ +-+ + + + + +-+-+-+ + + + +-+ + +-+-+ + +-+-+ + +-+ +-+ +-+-+-+ + + +-+-+-+ +-+ +-+ + + +-+ + + +-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + + +-+ +-+ + + + +-+ + +-+-+ + +-+-+ +-+-+ +-+ +-+-+ +-+-+-+-+-+ +-+-+ + +-+-+-+ + +-+-+ +-+ +-+ +-+-+-+ + +-+-+-+-+-+ + +-+-+ +-+-+-+ + +-+-+-+-+-+ +-+-+ + +-+-+ + +-+-+ + + + + +-+-+ + + +-+-+-+-+ + +-+ + +-+ +-+-+-+-+ +-+-+-+ +-+-+ +-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ +-+ +-+ + + +-+-+ +-+ + + + +-+ + + + + +-+ +-+ +-+-+ +-+ +-+ + + +-+ + + + + +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+ + +-+ + +-+ + + +-+ + +-+-+ + +-+-+ +-+-+ + +-+-+-+-+ + +-+-+ +-+ +-+-+ +-+-+-+ + +-+-+-+ + +-+ + +-+ +-+ + + + +-+-+ + + + + +-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+-+-+ + + + + + + + + + + + +-+-+ + + + + +-+ +-+ +-+-+-+ + +-+ + + +-+-+ +-+-+ +-+-+-+ + + +-+-+-+-+-+ + +-+-+-+ +-+ +-+ + +-+ + +-+ +-+-+ + + +-+ + +-+-+ + +-+ + + +-+ + + +-+-+-+-+ + +-+-+ + +-+-+-+-+-+ +-+-+-+ + + + +-+-+ + + +-+-+ + + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+-+ +-+-+-+-+-+ + +-+ + + + +-+ +-+ + +-+ +-+-+-+ + +-+ + +-+-+-+ + +-+ + +-+ + + +-+ +-+-+ + + + +-+-+-+-+-+-+ +-+ +-+ + +-+ + +-+-+ +-+ +-+ +-+ + + + + + +-+-+ + + + + + + + +-+-+-+-+ + + +-+ + + + + + +-+-+-+-+-+-+ + +-+-+-+ + + +-+-+ +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+ + +-+ +-+-+-+ + +-+-+-+-+ +-+-+-+-+ +-+-+-+ +-+ + +-+-+-+-+-+-+ + + +-+-+-+-+-+-+ + + +-+-+-+ + +-+ +-+-+ + +-+-+ + +-+-+ +-+-+-+-+-+-+ + + + +-+-+ + + +-+ + +-+-+-+-+-+ +-+-+-+-+ + + + +-+-+-+-+-+-+-+-+ + + + + +-+ + +-+-+ + + + +-+-+-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+-+ +-+-+ + + + + + +-+ +-+-+-+ + + +-+-+-+-+-+-+ + + + +-+-+ +-+-+ + +-+-+-+-+-+-+ + + +-+ + + + +-+ +-+-+ + +-+-+ + + + + + + + +-+-+-+ +-+ +-+ + +-+-+ +-+ +-+-+-+ + + + +-+ + +-+ + +-+ + + +-+-+ + +-+-+-+ +-+ + +-+-+ + +-+-+-+ +-+-+ + + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + + + +-+-+ + +-+-+ + +-+ +-+-+-+ +-+-+ + +-+-+ + +-+-+-+-+ + + + + +-+-+-+-+ + +-+ + +-+-+ + + + +-+-+ +-+ +-+-+ + +-+-+ +-+-+-+-+-+-+-+-+-+-+ +-+ +-+-+ +-+ + + + +-+ +-+-+-+ +-+-+ + + + + + + +-+ +-+-+-+-+-+ +-+-+ +-+ + +-+ +-+-+ + + + + +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+-+ + +-+-+-+-+-+-+-+ + + + + + + +-+-+-+ + + +-+ + + + +-+-+ + + + +-+-+ + +-+ + + +-+ +-+-+-+ +-+-+ +-+-+ +-+-+-+-+ +-+ +-+-+-+-+ + + + +-+-+ +-+-+ +-+-+-+-+-+-+ + + +-+ +-+ + + + + + + + +-+-+-+-+ + +-+-+-+ + +-+ +-+-+ + +-+ + + +-+ +-+-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ + + + +-+ + + + +-+-+ + +-+-+-+-+-+ + +-+-+-+ + +-+ + + +-+-+ + +-+-+ + +-+ + + +-+-+-+-+-+-+-+ + +-+-+ +-+ + + + +-+ +-+ + + + + + + + + + + + +-+-+-+ + + +-+ + +-+-+ + +-+-+-+-+ + +-+-+ + +-+ + +-+-+ + + + + + +-+-+-+-+-+ +-+ + +-+-+-+ + + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+ + +-+-+ + + + +-+-+-+-+-+ + +-+-+-+-+-+-+ + +-+ +-+ + +-+-+-+-+-+-+-+-+ +-+-+ + +-+-+-+-+-+-+ + + + + +-+-+-+ +-+ +-+-+-+-+-+ +-+-+ +-+-+ + +-+-+ + + + +-+-+ + +-+-+ + +-+-+ + + + +-+-+ + +-+ + +-+ + + +-+ +-+ + +-+ +-+ + +-+ +-+ + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+ +-+-+ + +-+-+-+-+-+ +-+ + +-+-+ + +-+-+-+ + + + +-+ + +-+-+-+-+ +-+ +-+ +-+-+ + + + + + + + + + +-+-+-+ +-+ +-+-+-+-+ +-+-+ +-+ + +-+-+-+-+ +-+ +-+ +-+ + +-+-+-+-+-+ +-+ +-+ +-+-+ + +-+-+-+-+-+-+-+-+-+-+ +-+-+-+ +-+-+ + + +-+-+-+-+ + +-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + + +-+-+-+-+ +-+ +-+ +-+-+-+-+-+ + +-+-+ + +-+ + + + +-+-+ + + + + +-+-+ +-+ + + +-+ +-+-+ +-+-+ +-+-+ + +-+ + + +-+-+ +-+-+ + +-+-+ +-+-+-+ +-+ +-+-+ +-+-+ + +-+-+ + +-+ +-+ +-+-+ + + + + +-+ + +-+ + +-+-+ + +-+-+-+-+ + +-+ + + + + +-+-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+ + +-+ + +-+ + + + +-+ + +-+-+ + + + +-+ +-+-+ + +-+-+-+-+ + + +-+ + + + +-+-+ + + + +-+-+ +-+ + + +-+-+-+-+ + +-+-+ + +-+-+-+ + +-+-+-+-+-+ + +-+-+-+ + + + +-+ +-+-+ + +-+-+-+ + +-+-+ + + +-+-+ + + + + + +-+-+ + +-+-+-+ +-+-+ + +-+-+-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+-+-+ +-+ +-+-+-+-+ +-+-+-+ + +-+ +-+-+ +-+-+-+ +-+-+ + +-+-+ +-+ +-+-+-+ + + + +-+-+-+-+ +-+ +-+ + + +-+ + +-+-+ + +-+ + +-+-+-+ + + + + + + +-+ + +-+-+-+-+-+ + +-+-+-+ +-+-+-+-+ + + +-+-+-+-+-+-+-+-+-+ +-+ + +-+-+ +-+-+-+ + +-+ +-+-+-+-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+ + +-+-+ + +-+-+-+ + +-+-+-+-+-+-+ +-+-+ +-+ + + +-+-+-+-+-+-+-+-+ + + +-+ +-+-+-+-+-+-+ + + +-+-+ +-+-+-+ + +-+ + +-+-+ +-+ + + + +-+ + + + +-+-+-+-+-+ + + + +-+ + + + +-+-+-+-+ +-+-+ + + +-+ + +-+-+ + + + +-+-+ + + +-+ +-+ +-+-+ +-+ +-+-+ + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+-+ + +-+-+-+-+-+ +-+-+-+-+-+-+-+ +-+-+ +-+ +-+-+ +-+-+-+-+-+-+-+ +-+ +-+-+-+ + +-+ +-+-+ +-+ + + +-+-+-+-+-+-+-+ + + + + +-+-+-+ +-+-+-+-+-+ + + + +-+-+ +-+-+-+ +-+-+ + +-+ + +-+ +-+ + + +-+-+-+ + +-+ + +-+ +-+-+-+-+ + + + +-+-+-+-+ + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+ +-+ + +-+-+ + + +-+ + +-+-+-+ + + +-+ + + + + +-+ + + +-+ + +-+ + +-+-+-+ + +-+-+ + + +-+ +-+ +-+-+-+ + +-+-+-+-+-+ +-+ +-+-+-+ + +-+ + +-+-+-+-+-+-+ + + +-+-+ + +-+-+ +-+ + +-+-+-+-+ +-+-+-+ + +-+-+ + +-+-+ +-+-+-+ + +-+-+-+ + + + + +-+-+ +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+-+-+-+ + +-+ +-+-+-+-+-+-+-+ +-+ + + + + + + + +-+-+ +-+-+-+ + + + + + +-+ + +-+ +-+ +-+ + + + +-+-+-+ + + +-+-+-+-+-+ +-+-+-+-+ +-+-+ + +-+-+ + + + +-+ +-+-+ + + + + +-+ + + + + +-+ +-+ +-+-+ + + + +-+-+ +-+-+ + + + +-+-+-+ + +-+-+-+ +-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + + + +-+-+-+ +-+ +-+ +-+ + + +-+ +-+-+ + +-+ + + + +-+-+ +-+-+-+-+-+-+-+-+ + + + + + +-+ +-+-+-+-+ + + +-+-+-+-+-+ +-+ + + +-+-+ +-+ + +-+ + +-+-+ +-+-+ + + +-+-+ +-+ + + +-+ +-+ + + + + +-+ +-+-+ +-+ +-+ +-+ + +-+-+-+ + + + +-+-+ + + +-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ +-+-+ + +-+ + +-+ + + + + +-+-+-+-+-+ + + +-+ +-+ + + + + +-+-+-+-+ + + +-+-+-+ + + +-+-+ +-+ + + + +-+ +-+ + +-+-+ + +-+-+ +-+-+-+ + +-+ + +-+-+-+ +-+-+ +-+-+-+ + +-+ + + + + +-+ +-+-+-+-+-+-+-+ + +-+ +-+ + + +-+ + +-+-+-+-+-+ + + +-+-+ + + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + +-+-+ +-+-+-+-+ + +-+ +-+-+-+-+ + + +-+-+ + + +-+-+ + + +-+ + + + + +-+-+-+ + +-+ +-+-+ +-+-+-+-+-+ +-+ +-+-+ + + + +-+-+-+ +-+ + + +-+-+-+ +-+ + + + +-+-+ + +-+-+-+-+-+-+-+-+ + + +-+ + +-+-+ + +-+ +-+-+-+ +-+-+-+-+ + +-+-+ +-+-+-+ + + +-+-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + +-+-+ +-+-+-+-+-+ + + +-+-+ + +-+-+ +-+-+-+-+ +-+-+ +-+ + +-+-+ + + +-+-+-+-+ + + + + + + + +-+ +-+ +-+-+-+ +-+ + + +-+ +-+ + + +-+ + +-+-+ +-+-+-+-+-+-+-+-+ + +-+-+ + +-+-+-+-+ + +-+ +-+ +-+-+ +-+-+-+ + + +-+-+ + + + + + + + +-+ + +-+-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ +-+-+ + +-+-+-+ + + +-+-+ + + +-+-+ +-+-+-+-+ +-+ +-+-+-+ + + + +-+-+ + + +-+-+ + +-+-+ +-+-+ + +-+-+ + +-+-+-+-+ +-+ +-+ +-+ +-+-+-+ +-+-+ +-+ +-+-+-+-+-+-+-+ +-+-+ + + + + +-+-+ + +-+ +-+ + + + + + + + +-+ +-+ + +-+ + +-+-+ + + + +-+-+-+-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + +-+-+ + +-+-+-+ + + +-+-+-+ +-+-+ + +-+ +-+ + + +-+ +-+-+-+-+ +-+-+-+-+-+-+ + + +-+-+ + + +-+ + + +-+ + + + + + +-+-+-+ +-+-+-+ + +-+-+-+ +-+ +-+ + + +-+ + + + +-+-+ + + + + +-+-+ +-+ +-+-+-+ +-+-+ + + + +-+-+ +-+-+-+ + + + + +-+ + +-+ + + +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+-+ + +-+ + +-+ +-+-+-+-+-+ + + + + +-+ +-+-+-+-+ + +-+-+-+ + +-+-+-+ +-+-+ +-+-+-+ +-+-+-+ + + +-+-+ +-+ +-+ +-+ + + + +-+-+ + + +-+-+ + +-+-+ +-+-+ + + + + +-+-+ +-+-+-+-+-+-+ + +-+ +-+ + +-+-+-+-+-+ + + + + + +-+ +-+-+ +-+-+-+ + +-+ + +-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ + +-+ + + + +-+-+-+-+-+ + + + +-+ +-+-+ +-+-+-+-+-+-+-+-+-+-+ + +-+ + + +-+ + +-+ +-+ + + + + + + +-+ + +-+ + + +-+ +-+-+ + + +-+-+-+ + + + + +-+-+-+ + +-+-+-+ +-+ + +-+-+ +-+ + + +-+-+ +-+ +-+-+-+-+-+-+ + +-+ + + +-+ + + + +-+-+-+ + +-+ +-+ + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+-+-+-+ + + +-+-+-+ +-+-+ +-+-+-+-+-+ +-+ + + + +-+ +-+-+ +-+-+ + + +-+ + +-+ +-+-+-+ + +-+-+-+-+-+-+-+-+ +-+ +-+-+-+-+ +-+-+-+-+ +-+-+-+-+ + +-+ + +-+ + + +-+-+-+ +-+-+-+-+-+-+-+-+-+-+ +-+-+-+ + + + + +-+-+-+ + + + + +-+ + +-+ + +-+-+-+ + + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + + + + + + +-+-+-+ +-+-+ + + +-+-+ + +-+ +-+ +-+-+ +-+ + +-+-+-+-+ + + +-+-+ +-+-+-+ +-+-+ +-+-+-+ + + + + +-+-+ +-+-+ + +-+-+-+ + + +-+-+-+ +-+ +-+-+ + + +-+ +-+-+-+ + + +-+-+ +-+ + + +-+-+-+-+-+ +-+-+ + +-+ +-+-+-+-+-+ + + + +-+ + + +-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ + +-+-+-+-+-+ + +-+ +-+-+-+-+ + +-+ + + + + + + +-+ +-+-+ + +-+-+-+ + + +-+ + +-+ +-+-+ +-+-+ + +-+-+ + +-+ +-+-+ +-+-+-+ +-+-+-+ + +-+-+ + +-+-+-+ + +-+ + + + +-+ +-+-+-+ + + + +-+ + + + +-+-+ +-+-+-+-+ +-+-+ + +-+-+-+-+-+-+-+-+ +-+ + +-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+-+ +-+-+ + + +-+-+-+ +-+ +-+-+-+ + +-+-+-+-+-+-+-+-+ + +-+ +-+ + + + +-+ +-+-+ + + + + +-+ + +-+-+ + +-+-+-+-+ + +-+-+ +-+-+ + +-+ + +-+-+-+ + +-+ + + + + +-+ + +-+-+ + +-+-+ +-+ + +-+ + +-+ + + + +-+ +-+-+ + +-+ + +-+ + + + + +-+ +-+-+-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + +-+-+-+-+-+-+ + + + + +-+ +-+ + + + +-+ + + +-+ + + + + + +-+-+ +-+ +-+ + +-+ + +-+-+-+-+-+-+ + + +-+-+-+ +-+-+ + + + +-+-+ +-+ + + +-+-+ + + +-+ + +-+-+-+ +-+ +-+ + + + +-+-+ + + +-+-+ + +-+ + + + +-+-+-+ +-+-+-+-+-+-+ + + + +-+ +-+-+ +-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ + + + + + +-+ +-+-+-+-+-+ + +-+-+-+ +-+ + + +-+-+ + + +-+ + +-+-+-+ + + +-+-+ + + + + +-+ + + +-+ + + +-+-+ +-+ +-+-+-+ +-+ +-+ +-+-+ +-+-+-+ +-+-+ +-+ +-+-+ +-+-+ +-+ +-+ + + +-+ + +-+-+-+-+-+-+ + +-+ + + +-+ +-+-+-+ +-+-+ + + +-+-+-+ +-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+-+-+ + +-+-+-+ + +-+ + + +-+-+-+ +-+ +-+-+-+ + +-+ + +-+ + + + + + +-+-+ +-+-+ + +-+-+ +-+ + + +-+-+-+-+ + + +-+ + +-+-+-+-+-+-+-+-+-+ +-+ + + +-+-+ + +-+ + + +-+-+ +-+ + +-+ + +-+ + + + +-+-+ + + + +-+-+ + +-+ +-+-+-+ +-+-+ +-+-+-+-+-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + + + + + + + + + +-+-+ + +-+ +-+-+ + + +-+ +-+ +-+-+ + +-+ +-+-+-+-+-+ + + + + + + + +-+ +-+ + +-+-+ +-+-+ +-+ +-+ + +-+ +-+-+ + +-+-+-+ +-+-+ +-+-+-+ + + + + +-+-+ +-+-+-+-+-+ +-+ + +-+-+-+-+-+ + +-+-+-+ +-+-+ + +-+ + + +-+ + +-+-+-+ + + + + +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+-+ +-+-+-+-+ +-+ +-+-+-+-+ + +-+-+-+ + +-+-+-+ +-+-+-+-+-+ +-+ + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + +-+-+-+-+-+ + + + +-+-+ + +-+ + + + + + + +-+ +-+-+-+ +-+ +-+ + +-+-+-+-+ +-+ + +-+ + +-+-+-+-+ + +-+ + +-+-+-+-+ + + +-+ + + + +-+ +-+-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+ + +-+-+ + +-+ +-+ +-+ + +-+-+-+ + + +-+-+-+ + +-+ +-+-+ +-+ + +-+ + + +-+-+-+-+-+-+ + + + +-+-+ + +-+-+ + + +-+ +-+ +-+-+ + + + + + + +-+ + + +-+ +-+ + + +-+-+ + +-+-+-+-+-+ +-+ +-+ + +-+-+ +-+-+-+-+-+ +-+-+-+-+-+ + + +-+-+ + + +-+-+-+ + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ +-+-+-+-+-+-+ +-+-+-+ +-+ + + + + +-+-+ +-+-+-+ + + + +-+-+ +-+-+ + + +-+-+ + +-+ +-+-+-+ +-+-+ +-+-+-+ + + +-+ +-+-+-+ +-+ +-+ +-+-+ + + + +-+ + +-+ + +-+-+-+ +-+ +-+ + + + +-+ + +-+-+ +-+ + + + +-+-+-+-+-+-+-+ + +-+ + + + + +-+-+ + + + +-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ +-+ +-+-+-+-+ +-+-+ + +-+ + + +-+-+-+-+ + + + +-+-+-+-+-+-+-+-+-+ +-+ +-+-+-+-+-+-+-+ +-+ +-+-+-+ +-+-+ +-+ + + +-+ + + +-+-+-+ +-+ + +-+-+-+ + + +-+-+-+-+ +-+ +-+ +-+ + + +-+-+-+-+-+-+-+ + + +-+-+-+ + +-+-+ + + + +-+ + +-+-+-+-+ +-+-+ +-+-+ + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + +-+ + + +-+-+ + +-+-+ + +-+-+ + + + + + + + + +-+-+-+ + +-+-+ +-+ +-+-+ + + +-+ + +-+-+-+ +-+ +-+-+-+-+ + +-+-+-+-+ +-+-+-+-+-+-+ +-+-+ + + + +-+-+ +-+ + + + + +-+ +-+ + +-+-+-+-+-+-+-+-+-+-+ + + +-+ +-+ +-+ + +-+ +-+-+ +-+-+ + +-+-+ + + +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+ + + + +-+ + +-+-+ + +-+-+ + + + + + +-+-+-+-+ +-+ +-+ + +-+-+-+-+ +-+-+ +-+ +-+ + +-+ +-+ +-+ + +-+ + + +-+ +-+ +-+ + + +-+-+-+-+ + +-+-+ +-+-+-+-+-+-+-+ +-+-+ +-+ +-+ + + +-+-+ +-+-+-+-+ + +-+ + +-+ +-+-+-+ + +-+ +-+ + + +-+-+ + +-+ + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+ + + + +-+ + +-+-+-+ +-+-+-+-+-+-+-+ + + + + +-+-+ +-+ +-+ +-+ + + +-+ + +-+ + +-+-+-+ + +-+ + +-+-+ +-+ +-+ +-+-+ +-+-+ +-+ +-+ +-+ + + + + + +-+ + + + +-+ + + +-+-+-+-+-+ +-+ + +-+ +-+-+-+-+ + +-+-+ +-+ + +-+-+-+-+-+-+-+ + +-+-+-+-+-+-+ +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + + + +-+-+ + +-+-+ + + +-+-+ + +-+ + + + +-+ +-+ +-+ + + + + + + +-+ +-+-+ +-+-+ +-+ + +-+ +-+-+-+ +-+ + + + +-+ +-+ + +-+-+-+ +-+ +-+-+ + + +-+ + + +-+-+ +-+ +-+-+ +-+ + +-+ +-+-+-+-+ +-+-+-+-+-+ +-+-+-+ + + + + + + + + +-+-+ +-+-+-+-+ + + + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+-+ + +-+-+ + +-+-+ +-+-+ +-+-+ +-+-+-+-+ +-+ + +-+ + +-+ +-+-+-+-+-+ +-+-+ +-+ + + +-+-+-+ + + +-+ + + + +-+-+-+ + +-+ +-+-+ +-+-+ +-+-+ + + +-+ +-+ + +-+ +-+ + +-+ + +-+ + + +-+-+ +-+ +-+-+-+-+-+ +-+ + + +-+ +-+ + +-+ + +-+-+ + +-+ + +-+-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + +-+-+-+-+ + +-+-+ +-+-+ +-+-+-+-+ + +-+ + + +-+-+ +-+-+ +-+-+-+ + + +-+ + + + + +-+ + +-+-+ +-+-+ +-+ + + + +-+ +-+-+ + + + +-+ + + +-+-+-+-+ +-+-+-+ + +-+-+-+ +-+-+-+-+ +-+-+ +-+ + +-+-+ +-+-+ + +-+ + +-+ + +-+ +-+-+-+-+-+ + +-+-+ + + +-+ +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+ +-+ +-+ +-+-+ +-+-+ + + + +-+ + + + + + +-+-+ +-+-+-+-+-+-+ + +-+-+ +-+-+-+ + +-+-+-+-+ +-+ + + +-+ + +-+-+ + + +-+ +-+-+ + +-+-+-+-+ + + + + +-+ + +-+ + + +-+-+-+ + +-+-+-+-+ +-+ + +-+-+ +-+-+-+-+-+ +-+-+ + + +-+ + +-+ +-+ +-+ + + + + + + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+ +-+-+-+ + + + +-+-+ +-+ + +-+-+-+-+-+ + + + + +-+-+-+-+ +-+ +-+ +-+ + +-+-+ + +-+-+-+-+ + +-+ + +-+ + +-+ + + + +-+-+-+-+ + + + +-+-+ +-+-+ + +-+ + + + + + + + + +-+ +-+-+ +-+ + + +-+ + +-+ + + + + + + + +-+ +-+-+-+ +-+ + +-+-+ + + + +-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+-+-+ + + + +-+ + + + +-+-+-+ + + + + + + +-+-+-+-+ +-+ + +-+-+ + +-+ + +-+-+-+-+ +-+ + + +-+ + +-+ + + + +-+ +-+-+ +-+ +-+ +-+ +-+ +-+ + + +-+ + +-+-+-+ + + + + +-+ +-+-+-+-+ + +-+-+-+-+ + +-+ +-+ +-+ + + + +-+ +-+ + + +-+-+-+-+-+ + + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+ +-+-+-+ + +-+-+-+ +-+-+ + +-+-+ +-+ +-+ + + +-+-+ +-+ +-+-+ + +-+ + +-+-+-+-+-+ +-+ + + +-+ +-+-+-+-+ + +-+ +-+ + +-+ +-+ +-+ +-+-+ +-+-+ +-+-+-+ + + + +-+ +-+ +-+ + + +-+ +-+ + + + + +-+ +-+ +-+ +-+ + +-+-+ + + + +-+-+-+-+ + + + + + + +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + +-+-+-+-+ + + + +-+-+-+-+-+ + + +-+ +-+-+-+ +-+-+ +-+ +-+-+ +-+ + + +-+-+-+-+-+-+ + + + +-+ + + +-+-+ + +-+ + + +-+-+-+-+-+ + +-+ + +-+ + +-+ + + + + + +-+ +-+ + + + + +-+ +-+ + + + + +-+ +-+-+-+-+-+ + +-+ +-+ + + + + +-+-+ +-+-+-+-+-+ +-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + + +-+ + + + +-+ + + + +-+-+ +-+ +-+ + + +-+-+-+ + +-+-+-+-+ +-+ + + + + +-+ + +-+-+-+ + + +-+-+-+ +-+-+ +-+ +-+ + + +-+ +-+ +-+ +-+ + + + +-+ +-+-+ +-+ +-+ + + + + +-+ + + + +-+-+ +-+ + +-+ + +-+-+-+-+ +-+-+-+-+ + + +-+-+-+-+ + +-+-+-+ +-+ + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + + + +-+-+ +-+ + + + +-+ +-+ +-+-+-+ + +-+-+-+-+-+-+ + + + +-+-+ +-+-+ + + +-+ + + + +-+ +-+-+-+ +-+-+-+ + + + + + +-+ +-+ +-+ +-+ +-+-+ + +-+ + + +-+-+ + +-+ + + +-+ + +-+ + + +-+-+ +-+ + + + + + + +-+-+-+-+ + + + +-+ + + + +-+ +-+ + +-+ +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+ +-+ + + + + +-+ + + + +-+ +-+ + + +-+-+-+-+ + +-+ +-+-+ +-+-+ + +-+-+-+-+-+ +-+-+ +-+-+-+-+ + + + +-+-+-+ +-+-+-+-+-+ + +-+-+ + +-+ +-+-+ +-+-+-+-+ +-+-+-+ +-+-+-+ +-+ +-+-+-+-+-+ +-+ +-+ +-+-+ + +-+ + + + +-+-+-+-+-+ + +-+-+ +-+ + + + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+ +-+-+-+ + + +-+-+ + + +-+-+ + + +-+-+ + +-+-+-+-+ +-+-+ +-+-+ + +-+-+ + + +-+-+ + +-+-+-+ + +-+ +-+-+ +-+ +-+ +-+-+ + + + + + +-+-+-+-+ + + + + +-+ + +-+-+-+ +-+-+ +-+-+-+ + +-+ +-+-+ +-+ + + + + +-+ +-+-+-+ +-+-+ + +-+-+ + + +-+ + +-+-+-+ + +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + +-+ + + +-+-+-+ +-+ + + +-+-+ +-+ + + + +-+-+ +-+-+ + + +-+ + + + +-+-+ +-+-+-+-+-+ + +-+-+-+ +-+-+-+-+ +-+-+-+ +-+-+-+ +-+-+ + +-+-+-+-+ + + + + +-+ +-+ + +-+ + + +-+-+ + + + +-+ + +-+-+-+ + +-+-+ +-+-+-+ + +-+ +-+ + + +-+ +-+ +-+ + + + + + + +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + +-+-+ +-+-+-+ + + +-+ +-+-+ +-+ +-+-+ +-+-+ +-+ + +-+-+ + +-+-+ + +-+ +-+ +-+ + +-+-+-+ +-+ +-+-+ + +-+-+ + + +-+-+-+-+-+ + + +-+-+ + + +-+-+ +-+ +-+-+ +-+-+-+-+ + + +-+-+-+-+ + + +-+-+ + +-+-+-+ + + + +-+-+-+-+-+ +-+ +-+ +-+-+-+ + + +-+ + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + + + +-+-+ +-+-+-+ + +-+-+-+ + + + + + + +-+ +-+ + + +-+-+-+-+-+-+ +-+ +-+ + + + +-+ + + +-+ +-+-+ + +-+ +-+-+-+-+ + + + +-+-+ + +-+ + + + +-+ +-+ + +-+-+-+-+ + +-+-+ +-+-+ + +-+-+-+ +-+ + +-+ + + +-+ +-+-+ +-+ + + +-+-+-+ +-+-+ +-+-+ + +-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+ +-+ + + + + + +-+-+-+ + +-+-+ + + +-+-+ + +-+ + + + + + + + + + +-+ +-+ +-+-+-+-+ +-+-+-+ + +-+ +-+-+ + + + +-+-+ +-+-+ + +-+-+ + +-+ + +-+ + + +-+ + +-+-+ + + + +-+-+ +-+-+ + +-+ +-+-+-+-+ + +-+-+-+-+ +-+-+ +-+ +-+-+-+ + + + +-+ + +-+ + +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ +-+ + + +-+-+-+-+ + + +-+ +-+ +-+ + +-+-+ +-+ +-+-+ +-+ +-+-+-+-+-+ +-+ +-+ +-+ + +-+ +-+ + + + +-+-+-+-+-+-+-+ + +-+ + +-+ +-+ + +-+ + +-+-+-+ + +-+-+ + + +-+-+ +-+-+ + +-+-+-+-+ +-+-+-+-+ + + + +-+ + +-+ + +-+-+-+ +-+ + +-+ + + + + + +-+ + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+ + + +-+ + +-+ + +-+ +-+ +-+ + +-+-+-+-+ + +-+ + +-+-+-+ +-+-+ +-+ + +-+ + + +-+ + + +-+ + + + + + +-+-+ + +-+-+-+-+ + +-+ + +-+ +-+ + + +-+-+ +-+-+-+-+ +-+ +-+-+-+ + +-+ +-+ + + + + + +-+-+-+-+ + +-+-+-+-+ +-+ +-+ + +-+-+-+-+ + +-+-+ + +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ +-+-+ + + + + + +-+-+ +-+ +-+ + +-+-+-+-+ + +-+ + + + +-+ + + + +-+ + +-+ +-+ +-+ + +-+-+ +-+-+ + +-+-+-+-+-+-+ + +-+-+-+-+-+ +-+ +-+-+-+-+-+-+ + + +-+ + + + +-+ +-+-+-+ + +-+-+-+ + + + + + +-+-+-+-+ + +-+ +-+-+ +-+ +-+ + + +-+-+-+-+-+-+ + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + + + + +-+-+ +-+ + +-+ + +-+-+-+-+ + +-+-+-+-+ +-+ + + + + +-+-+ + +-+ +-+-+ +-+-+ + + + + +-+-+ + + + +-+-+ + + + + + +-+ +-+ +-+-+-+ + +-+-+-+-+ + +-+ +-+-+ + + + + +-+-+-+ +-+-+ +-+-+ + + + + +-+-+-+ + +-+ +-+ + + +-+-+-+ + + +-+-+ + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+ + + + + +-+ + +-+-+-+-+-+-+ + +-+-+-+ + + +-+ +-+-+-+-+-+ + + + +-+-+ + +-+ + +-+ + +-+ +-+ +-+ +-+-+-+ + + +-+-+-+-+-+-+-+ +-+-+ +-+-+ + +-+-+-+-+ +-+-+ + +-+-+ +-+ + +-+-+ + + + +-+-+-+ +-+ + +-+-+-+-+-+-+-+-+-+-+ +-+-+ + + + + + + + + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ + +-+-+-+-+ + + +-+-+ +-+-+ + +-+-+-+ +-+ +-+ +-+ +-+-+-+-+ +-+ +-+ + +-+ +-+-+ +-+-+-+ + + +-+-+-+ + + + + +-+ + + + + + + +-+ + +-+ + +-+ +-+-+-+-+ +-+ +-+-+-+-+-+ + + +-+ + + +-+-+-+ + +-+ +-+-+ + + + + + +-+ + +-+-+-+-+-+ + +-+ +-+-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + + + + + + + +-+-+-+-+ + + + + +-+ +-+ +-+ +-+ + +-+-+ +-+-+ +-+ +-+ + +-+-+-+ + +-+ +-+ + + + + +-+-+-+-+-+ + +-+-+-+-+ + + +-+ +-+ + + +-+-+-+ + + + + + + +-+-+ + + +-+-+-+-+-+-+ +-+-+ + +-+ +-+-+-+-+ + + + +-+ + + + + + +-+ +-+-+ + + + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ + +-+-+ +-+ + +-+ + +-+ + + +-+-+-+ + + +-+ +-+ +-+ + + + + +-+-+ +-+-+-+-+ + +-+ + + +-+-+ + + +-+-+ + +-+-+ + +-+ + +-+ +-+ +-+ +-+-+-+-+ +-+-+-+-+-+-+-+-+-+ + + + +-+-+ +-+-+ + +-+-+ +-+-+-+ +-+ + +-+-+-+ + +-+-+-+ +-+-+ + +-+-+ + +-+ + + +-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + +-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+ + + +-+ +-+ +-+-+ + +-+-+ +-+-+-+-+ + +-+ + +-+-+-+ +-+-+-+-+-+-+-+ +-+ + + +-+-+-+-+ +-+ +-+ + +-+ + +-+ +-+-+ + +-+-+-+-+ + +-+ +-+ + +-+-+ + + +-+ + + +-+ + + + +-+-+-+ + +-+-+ +-+-+ +-+ + + + + +-+ +-+-+-+ +-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+ + + + +-+-+-+-+-+-+ + + + + + + + + + + +-+ +-+ + +-+-+-+-+ + +-+-+-+-+-+ + + +-+-+-+-+ + + +-+ + +-+-+ + +-+-+-+ +-+ + + + +-+-+ + + + +-+-+-+ +-+-+ +-+ +-+ +-+-+-+ +-+ + + + + + + +-+-+ +-+-+ +-+ +-+ +-+-+ + +-+-+ + +-+ + + +-+ +-+ +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + +-+-+-+-+-+-+-+ + +-+-+ + +-+-+-+-+ +-+ + + +-+-+ +-+ + + +-+-+-+-+-+-+-+ +-+-+ + + +-+-+ + + +-+-+ + + + + +-+-+-+-+-+-+-+ + + +-+-+ +-+-+-+-+-+-+-+-+-+ + +-+-+ + +-+ + + +-+-+-+-+ + +-+ + + +-+-+ + +-+ +-+ +-+-+-+ +-+ +-+-+-+ + +-+-+ +-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+ +-+-+ +-+ + +-+-+ + +-+-+-+ + +-+ +-+-+-+-+ + +-+-+-+ +-+-+ + +-+-+-+ + + + +-+ + +-+-+-+ +-+ + + + + +-+-+-+ + + + +-+-+-+-+-+ + +-+ + +-+ +-+ + + +-+-+-+-+ + +-+ + + +-+-+-+-+-+-+ +-+-+-+-+ + + +-+-+-+ + + + + +-+ +-+-+-+ + + +-+-+ + +-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+-+-+ +-+-+ + +-+-+ + +-+ + + +-+ +-+-+ +-+-+ + +-+-+-+ +-+-+ + + + + +-+-+-+-+ + +-+-+ + + +-+ +-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + + +-+ +-+ + + + + +-+ +-+ +-+ +-+-+ + + +-+-+-+-+ + + +-+ + +-+-+ +-+-+ + +-+ + + + +-+ + + + + + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ + + + +-+-+-+-+-+-+ + +-+-+-+-+-+ + +-+ + + +-+-+ + +-+-+-+-+ +-+-+-+-+-+-+-+ + + + +-+ + +-+ + +-+-+-+-+-+ + + + +-+-+ + +-+-+ + +-+-+-+-+ +-+-+ + +-+-+-+ + + +-+ + +-+-+ + +-+-+ +-+ + +-+-+ + +-+-+ +-+-+-+ + + + + +-+ + +-+ +-+ +-+-+-+-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+ + + +-+ + + +-+-+-+-+ + + + +-+-+-+ + +-+ + + +-+-+ + + +-+ +-+ +-+ +-+-+-+ + + + +-+-+-+ + + +-+ + + + + +-+-+-+-+ + + + + + +-+-+ + + + +-+ + +-+-+-+ + +-+ + + +-+-+-+ + +-+-+-+ +-+-+-+ +-+-+-+ + +-+-+ +-+ + +-+-+-+ +-+-+-+-+ +-+ + + + + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ + + + + + +-+ +-+ +-+-+-+-+ +-+-+ + +-+ + +-+ +-+ + +-+-+-+-+-+ + + + + + + + + +-+ + +-+ + +-+ + +-+-+-+-+-+ + +-+ +-+-+-+-+ + + + +-+ + + + + + +-+ + + + + + +-+-+ + + + +-+-+ + +-+ + + +-+ +-+-+-+-+-+ +-+ + +-+ + + + + +-+-+-+-+ +-+-+-+-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+ +-+ + + +-+-+ + + +-+ + +-+ + +-+-+ +-+ +-+ + + + +-+-+-+ +-+-+-+ +-+-+-+ +-+-+ + +-+ +-+-+ + + +-+-+-+ + +-+ +-+-+ + +-+-+-+ +-+ + +-+-+-+-+-+ + + + +-+-+-+-+ + +-+-+ + + + +-+ +-+-+-+ +-+ +-+-+-+-+-+ + + +-+ + +-+-+-+-+ +-+-+-+ + +-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+ + + + +-+ +-+ + + +-+-+ + + +-+ + + + + + + + +-+ + + + + + +-+-+-+ +-+-+-+ +-+ +-+-+-+ + + + + + + + + + + +-+-+ + + + + +-+-+ + + +-+ + +-+ + + +-+-+ +-+-+-+ +-+-+ + +-+ + +-+-+ +-+ + + + + +-+ +-+ + + + + +-+-+ + + + +-+-+-+ +-+-+ + + + + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+-+ +-+ + + + +-+-+-+ +-+-+-+-+-+-+ +-+-+-+ +-+-+-+ + + + +-+ +-+ +-+ +-+-+-+ + + +-+ + + + +-+-+-+-+-+ +-+ +-+ + + +-+ + +-+ + + +-+-+-+ + +-+-+ +-+-+-+ + + +-+ + +-+-+ + +-+-+ + + + +-+-+-+ + +-+ + + +-+ +-+-+ + +-+-+ +-+-+-+-+-+ +-+ +-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ + + +-+-+-+-+ +-+ + + +-+ + +-+-+ + +-+ + + +-+-+-+-+ + +-+-+ +-+ +-+-+-+-+ + +-+-+ + +-+ + +-+ + + +-+ +-+ +-+-+-+ + + +-+ + +-+ + +-+ + + + + +-+-+ + + +-+ +-+-+ +-+ + + + + + + +-+-+-+ + + +-+-+ + +-+ + +-+-+ +-+ + + + + + + + + + + + + +-+-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+ +-+-+-+-+ +-+ + + + +-+-+-+-+-+ +-+-+-+ + + +-+-+-+-+-+-+ +-+ +-+ + +-+ + +-+-+ + +-+-+ + + +-+-+-+ + + +-+ + + +-+-+ + + + + +-+ +-+-+ + + +-+ + +-+ + +-+-+ + +-+ +-+ +-+ + + + + + + +-+ +-+-+ + +-+ + +-+-+ + + +-+ + +-+ +-+-+ +-+ + +-+-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+ + + +-+-+ + + +-+ + + + +-+-+-+ + +-+ + +-+-+-+ + +-+ +-+ +-+-+-+ +-+-+ +-+-+-+-+-+-+-+ + + + + +-+-+ +-+-+-+ +-+ + +-+-+ +-+-+-+ +-+-+-+ + +-+ + +-+ + + +-+-+ + + + + +-+ +-+-+-+-+-+-+-+ + +-+-+ + +-+-+ + + + +-+-+-+ +-+ + + + + +-+-+ + +-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+ + + +-+-+-+ + +-+ +-+-+-+ +-+ + +-+-+-+ + + +-+ +-+-+ + +-+-+ + + +-+-+ +-+ + + + + + +-+-+ +-+-+ +-+ + + + + +-+ + + +-+-+ +-+ + + +-+-+-+ + +-+-+-+ + +-+-+-+ + +-+ + + + + + + + + + +-+ +-+ + + + + +-+ +-+-+-+ + + + + + +-+-+-+-+ + +-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+-+ + +-+-+-+-+-+ +-+-+ + +-+ + + +-+ + +-+ + +-+-+-+-+-+ + + + +-+-+-+-+ + + + + +-+ + +-+-+-+ + +-+-+ +-+-+ +-+-+-+-+ +-+-+ +-+-+-+-+ + + +-+-+-+ +-+ +-+-+-+ + +-+ + +-+-+-+ + +-+-+ + + + + + + + +-+-+ + + + + + + + + + +-+ + + + +-+-+ + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+-+-+ + + + + + + + +-+ + +-+ +-+-+-+-+ +-+-+ +-+-+-+-+-+ + +-+-+ + + + +-+-+ + + + + +-+-+ + + + +-+ + + +-+-+ +-+ + +-+ +-+ + +-+ + +-+-+-+-+ + +-+ +-+ +-+-+ + + +-+-+ +-+-+ + +-+ + + +-+ +-+-+ +-+ + + +-+-+-+-+-+-+ +-+-+-+-+ + + +-+-+ +-+ + + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+ +-+-+ + +-+-+-+-+ + + + + + + + +-+-+ +-+ +-+ + + + +-+-+-+-+-+-+-+ + +-+-+ + +-+-+ +-+ +-+-+ +-+-+ +-+ +-+ + + + +-+-+ +-+ +-+ + +-+-+-+-+-+ + +-+ + + +-+-+-+-+-+-+-+ +-+-+ + + + + +-+-+ +-+-+ + +-+-+ +-+-+-+-+-+-+ +-+-+ + + +-+-+-+-+-+-+-+ + + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+-+ + +-+ + + +-+ +-+ +-+-+-+-+ + +-+ + + +-+-+ +-+ + + +-+-+-+ +-+ +-+-+ + + + +-+ +-+-+ +-+-+-+-+ +-+-+ +-+ + + +-+-+-+-+-+ + + +-+ + + + +-+-+ + +-+-+-+-+-+ +-+ + +-+ +-+-+ + + +-+ + + +-+ + +-+-+ + +-+ +-+-+-+ + + +-+ +-+ +-+-+-+ +-+ + + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+ +-+-+-+ +-+ +-+-+-+ +-+ +-+-+-+-+ + +-+-+-+ + + +-+-+-+-+-+-+ +-+ +-+ +-+-+ +-+ + +-+ + +-+-+-+ +-+ + +-+ + +-+ +-+ +-+-+ + + + +-+-+-+ +-+ + + + +-+-+ + +-+ + +-+ + + + + + + + + +-+ + +-+ + +-+-+ + +-+-+ +-+ +-+-+ +-+-+ + +-+ + + + +-+-+-+-+ + + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + +-+ + + + + +-+ +-+ +-+-+ +-+-+ + + +-+ + +-+-+ + +-+ + + + + +-+ +-+-+-+ +-+-+ +-+ + +-+ + +-+ +-+-+-+-+-+-+-+-+-+ + + + +-+ +-+ +-+ +-+-+-+ +-+-+-+-+ +-+-+-+-+-+ +-+ +-+ + +-+-+ +-+ +-+-+ +-+-+-+ + +-+-+ + + +-+ + +-+ + + + + +-+-+-+ + +-+-+-+-+-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + +-+-+-+-+ + +-+ +-+-+ + + + + + + + +-+-+-+ + + + +-+-+ + + + +-+ + + +-+-+ +-+-+-+ + +-+ + +-+ + +-+ +-+ + + + + +-+-+ + +-+-+-+-+-+ +-+ + +-+-+-+-+-+-+-+-+-+ +-+ + + +-+-+-+ + + +-+-+ + + + + + + +-+ + +-+-+ +-+-+ + +-+-+ + + + + + +-+-+ + + +-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ +-+-+ + + +-+ +-+ + +-+-+-+ + +-+ + +-+-+ + + + + + + + + + + + +-+-+-+ +-+-+ + + +-+ +-+-+-+-+-+ +-+-+ + +-+-+-+-+-+ +-+-+ +-+-+-+ + + +-+-+ + + + + + +-+ + +-+ + + +-+-+-+ + + + +-+ + +-+ + + +-+-+ +-+ +-+ +-+ +-+ +-+ + + +-+-+ + + + +-+ + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+ + + +-+-+-+ +-+ +-+ + + + + +-+ + + + +-+-+-+-+ +-+ +-+ +-+-+-+-+ + + +-+ + +-+ +-+-+-+ + + + + + +-+-+ +-+ +-+-+-+-+ + + +-+-+-+ + + + +-+-+-+-+-+-+ +-+-+ +-+-+-+-+-+-+-+ + + +-+-+ +-+-+-+ + +-+-+ +-+ +-+ +-+ + + +-+ +-+-+ + + +-+-+ +-+-+ +-+-+
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ +-+ + +-+-+-+-+ + +-+-+ + +-+-+ +-+-+ +-+-+ + + +-+-+-+-+ +-+ + + + +-+ +-+-+ +-+-+-+ +-+ +-+-+-+-+ +-+-+-+-+ +-+ +-+-+-+ + +-+-+-+-+-+ + + +-+-+-+-+-+ +-+-+-+-+-+ +-+-+ + +-+ +-+ +-+ + + + +-+-+-+-+ + +-+-+ +-+ + +-+-+-+ + +-+-+ + +-+-+ + + + + +-+ + +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+ + + + + +-+ + +-+ + + +-+-+ + + + + + +-+-+-+-+-+ + +-+ + + + + + + + +-+ + +-+ + +-+-+-+ +-+ +-+ +-+ + + + + + +-+ + + +-+-+ + + +-+ + +-+ + + +-+-+-+-+ + +-+ + +-+ +-+-+-+ +-+ +-+ + +-+-+-+ + +-+ + + + +-+-+-+-+ +-+-+ +-+-+-+-+-+-+ + +-+ +-+-+-+-+-+ +
|
||||
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+~+
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
#include <ncurses.h>/*****************************************************/
|
||||
int m[256 ] [ 256 ],a
|
||||
,b ;;; ;;; WINDOW*w; char*l="" "\176qxl" "q" "q" "k" "w\
|
||||
xm" "x" "t" "j" "v" "u" "n" ,Q[
|
||||
]= "Z" "pt!ftd`" "qdc!`eu" "dq!$c!nnwf"/** *** */"t\040\t";c(
|
||||
int u , int v){ v?m [u] [v-
|
||||
1] |=2,m[u][v-1] & 48?W][v-1 ] & 15]]):0:0;u?m[u -1][v]|=1 ,m[
|
||||
u- 1][ v]& 48? W-1 ][v ]&
|
||||
15] ]):0:0;v< 255 ?m[ u][v+1]|=8,m[u][v+1]& 48? W][ v+1]&15]]
|
||||
):0 :0; u < 255 ?m[ u+1 ][v ]|=
|
||||
4,m[u+1][ v]&48?W+1][v]&15]]):0:0;W][ v]& 15] ]);}cu(char*q){ return
|
||||
*q ?cu (q+ 1)& 1?q [0] ++:
|
||||
q[0 ]-- :1; }d( int u , int/**/v, int/**/x, int y){ int
|
||||
Y=y -v, X=x -u; int S,s ;Y< 0?Y =-Y ,s,
|
||||
s=- 1:( s=1);X<0?X=-X,S =-1 :(S= 1); Y<<= 1;X<<=1; if(X>Y){
|
||||
int f=Y -(X >>1 );; while(u!= x){
|
||||
f>= 0?v+=s,f-=X:0;u +=S ;f+= Y;m[u][v]|=32;mvwaddch(w,v ,u, m[u
|
||||
][ v]& 64? 60: 46) ;if (m[ u][
|
||||
v]&16){c(u,v);; ;;; ;;; return;}} }else{int f=X -(Y>>1);; while
|
||||
(v !=y ){f >=0 ?u +=S, f-= Y:0
|
||||
;v +=s ;f+=X;m[u][v]|= 32;mvwaddch(w,v ,u,m[u][v]&64?60:46);if(m[u
|
||||
][ v]& 16) {c( u,v );
|
||||
; return;;;}}}}Z( int/**/a, int b){ }e( int/**/y,int/**/ x){
|
||||
int i ; for (i= a;i <=a
|
||||
+S;i++)d(y,x,i,b),d(y,x,i,b+L);for(i=b;i<=b+L;i++)d(y,x,a,i),d(y,x,a+ S,i
|
||||
); ;;; ;;; ;;; ;;; ;
|
||||
mvwaddch(w,x,y,64); ;;; ;;; ;;; prefresh( w,b,a,0,0 ,L- 1,S-1
|
||||
);} main( int V , char *C[
|
||||
] ){FILE*f= fopen(V==1?"prog.c"/******/ :C[ 1],"r");int/**/x,y,c,
|
||||
v=0 ;;; initscr (); Z(Z (raw
|
||||
() ,Z( curs_set(0),Z(1 ,noecho()))),keypad( stdscr,TRUE));w =newpad
|
||||
( 300, 300 ) ; for (x= 255 ; x >=0 ;x--
|
||||
) for (y= 255 ;y>=0;y-- )m[ x][ y]= 0;x=y=0;refresh( );while
|
||||
( (c= fgetc (f) )+1) {if(
|
||||
0||c==10|| x== 256){x=0;y++;if(y==256 )break;;} else{m[x][y]=(c ==
|
||||
'~' ?64 : c ==32 ?0: 16) ;;x ++;
|
||||
}}for(x=0 ;x< 256;x++)m [x][0]=16 ,m[ x][ 255]=16;for(y=0
|
||||
;y< 256 ; y ++) m[0 ][y ] = 16,
|
||||
m[255][y] =16 ;a=b=c=0; x=y =1; do{v++;mvwaddch (w, y,x ,m[
|
||||
x][ y]& 32? m[x ][y ] & 16?
|
||||
0| acs_map[l[m[x][y]&15]]:46 : 32);c==0163&&!(m[x][y+1]&16)?y++: 0;c
|
||||
== 119 &&! (m[ x][
|
||||
y- 1]& 16) ?y--:0;;c ==97 &&!(m[x-1][y]&16)?x--:0;c==100&&!(m[x+1
|
||||
][ y]& 16) ? x ++:0 ;if( c==
|
||||
3- 1+1 ){endwin( );; return(0) ;}x -a<5?a>S- 5?a-=S-5:(a=0):
|
||||
0;x -a> S-5?a<255 -S* 2?a +=S
|
||||
-5:(a=256-S):0; y-b<5?b>L-5?b-=L-5:(b =0) :0; y-b>L-5?b<255-L *2?
|
||||
b+= L-5 :(b =256
|
||||
-L) :0;e(x,y);if(m[x][y]&64)break;}while((c=getch())!=-1);endwin();cu(Q);
|
||||
printf(Q,v);}
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,90 @@
|
||||
char a[80];
|
||||
int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][1000];
|
||||
int main(char*d){
|
||||
return main((char*)(srand(time(&h)),
|
||||
setjmp(p[2]),
|
||||
(k=atoi((gets(a),
|
||||
a+strspn(a," -"))))
|
||||
&&(b=k),
|
||||
b||++b,
|
||||
j+=-j,
|
||||
d=(char*)(&j),
|
||||
setjmp(p[1]),
|
||||
1<<1>j&&(k&=4>>3,
|
||||
i=1<<k,
|
||||
h<<=i+j,
|
||||
setjmp(p[0]),
|
||||
(h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
|
||||
setjmp(p[3]),
|
||||
(i||!++i)&&(h--||(k|=i),
|
||||
i/=2,
|
||||
longjmp(p[3])),
|
||||
longjmp(p[0])),
|
||||
k^=-1,
|
||||
k+=1<<037,
|
||||
setjmp(p[3]),
|
||||
k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
|
||||
setjmp(p[0]),
|
||||
t+=(rand()>>3)%015-t,
|
||||
e[s]&(1<<t)&&longjmp(p[0]),
|
||||
e[s]|=1<<t,
|
||||
g[i]=t|++s<<"\004"["\004"[1]]|t),
|
||||
k>>=1,
|
||||
i+=1<<1,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
putchar(0x20+!putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13])),
|
||||
++k^005&&longjmp(p[0]),
|
||||
putchar('\n'),
|
||||
setjmp(p[3]),
|
||||
putchar(0x1F+!!putchar(("BCDHS"[g[--k]>>4]))),
|
||||
k&&longjmp(p[3]),
|
||||
putchar('\n'),
|
||||
j+=1<<0,
|
||||
1^j||(d=(char*)gets(a)),
|
||||
longjmp(p[1])),
|
||||
s=1==(f=0),
|
||||
i=0<<1,
|
||||
setjmp(p[3]),
|
||||
i<4&&(j=i+1,
|
||||
setjmp(p[1]),
|
||||
j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
|
||||
g[i]=g[j],
|
||||
g[j]=k),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
|
||||
setjmp(p[1]),
|
||||
--j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
|
||||
s+=3*!j|!(++i^17),
|
||||
(j*=i*=4)&&(i=1),
|
||||
setjmp(p[3]),
|
||||
5-j<2&&(j=0,
|
||||
setjmp(p[1]),
|
||||
5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]:(s+=((g[j]&0xf)>8&&f++,
|
||||
!!g[j]*i)),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
|
||||
s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
|
||||
s--,
|
||||
s*=b,
|
||||
printf("$%d (%d) \n",
|
||||
c+=s,
|
||||
s+b),
|
||||
i=0,
|
||||
setjmp(p[0]),
|
||||
6>i&&(j=1,
|
||||
setjmp(p[1]),
|
||||
0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
|
||||
--j,
|
||||
longjmp(p[1])),
|
||||
i+=++i,
|
||||
longjmp(p[0])),
|
||||
longjmp(p[2])));
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
Best Calculated Risk:
|
||||
|
||||
Brent Burley
|
||||
500 S. Buena Vista St.
|
||||
Burbank, CA 91521
|
||||
USA
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make burley
|
||||
|
||||
Try:
|
||||
|
||||
./burley
|
||||
|
||||
This is a draw poker program. You start with $100. Input alternates
|
||||
between your bet and which cards to keep. Example:
|
||||
|
||||
5 <== you enter a bet of $5 (defaults to $1)
|
||||
J Q J 9 5 <== your hand is Jack of Clubs, Queen of Hearts,
|
||||
C H D S C Jack of Diamonds, 9 of Spades, 5 of Clubs
|
||||
123 <== you enter which cards you want to keep
|
||||
(enter 0 to 5 digits between 1 and 5)
|
||||
J Q J J Q <== your new hand is Jack of Clubs, Queen of Hearts,
|
||||
C H D S C Jack of Diamonds, Jack of Spaces, Queen of clubs
|
||||
$145 (45) <== Your new balance is now $145. You had a Full House
|
||||
so your payoff is 9 times your bet == 45
|
||||
|
||||
The payout is according to "Vegas rules":
|
||||
|
||||
Straight Flush 50 times your bet
|
||||
Four of a Kind 25 times your bet
|
||||
Full House 9 times your bet
|
||||
Flush 6 times your bet
|
||||
Straight 4 times your bet
|
||||
3 of a Kind 3 times your bet
|
||||
2 Pair 2 times your bet
|
||||
Jacks or Better 1 times your bet
|
||||
|
||||
The program allows you to go into debt. However I'm sure you would
|
||||
never control-C kill the program just because you got behind, right?
|
||||
On the other hand the program never willingly exits, so you have
|
||||
to leave even when you are ahead. :-)
|
||||
|
||||
Can you figure out a winning betting "strategy"? Then can you modify
|
||||
the program so this "strategy" no longer works?
|
||||
|
||||
Notice the clever use of setjmp() and longjmp() calls. Can you keep
|
||||
track of what state is being saved and restored?
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This program plays draw poker. What is unusual about it is that it
|
||||
is written as a single statement -- count the semicolons! (OK, there
|
||||
are really three statements if you count the variable declarations.) To
|
||||
keep things simple, I have avoided the C preprocessor and tricky
|
||||
statements such as "if", "for", "do", "while", "switch", and "goto".
|
||||
@@ -0,0 +1,94 @@
|
||||
char a[80];
|
||||
int e[4],g[5],c=100,h,i,j,k,b,f,s,t,p[4][100];
|
||||
int main(char*d){
|
||||
return main((char*)(srand(time(&h)),
|
||||
setjmp(p[2]),
|
||||
(k=atoi((gets(a),
|
||||
a+strspn(a," -"))))
|
||||
&&(b=k),
|
||||
b||++b,
|
||||
j+=-j,
|
||||
d=(char*)(&j),
|
||||
setjmp(p[1]),
|
||||
1<<1>j&&(k&=4>>3,
|
||||
i=1<<k,
|
||||
h<<=i+j,
|
||||
setjmp(p[0]),
|
||||
(h+=*d++-h)&&(-'1'^(h-='1'))&&(i<<=4,
|
||||
setjmp(p[3]),
|
||||
(i||!++i)&&(h--||(k|=i),
|
||||
i/=2,
|
||||
longjmp(p[3])),
|
||||
longjmp(p[0])),
|
||||
k^=-1,
|
||||
k+=1<<037,
|
||||
setjmp(p[3]),
|
||||
k&&((--i<5&&1&k)&&(s=(rand()>>9)%0x4,
|
||||
setjmp(p[0]),
|
||||
t+=(rand()>>3)%015-t,
|
||||
e[s]&(1<<t)&&longjmp(p[0]),
|
||||
e[s]|=1<<t,
|
||||
g[i]=t|++s<<"\004"["\004"[1]]|t),
|
||||
k>>=1,
|
||||
i+=1<<1,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
putchar(0x20,
|
||||
putchar(012+"(.7-A,G+@*J)/"[(017&(i=g[4-k]))*013%13],
|
||||
' ')),
|
||||
++k^005&&longjmp(p[0]),
|
||||
putchar('\n','\t'),
|
||||
setjmp(p[3]),
|
||||
putchar(0x20,
|
||||
putchar(("BCDHS"[g[--k]>>4]),
|
||||
'\n')),
|
||||
k&&longjmp(p[3]),
|
||||
putchar('\n','\t'),
|
||||
j+=1<<0,
|
||||
1^j||(d=(char*)gets(a)),
|
||||
longjmp(p[1])),
|
||||
s=1==(f=0),
|
||||
i=0<<1,
|
||||
setjmp(p[3]),
|
||||
i<4&&(j=i+1,
|
||||
setjmp(p[1]),
|
||||
j<5&&((017&g[j])>(g[i]&15)&&(k=g[i],
|
||||
g[i]=g[j],
|
||||
g[j]=k),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
setjmp(p[0]),
|
||||
i--&&!((g[1+i]^g[i])>>4)&&longjmp(p[0]),
|
||||
setjmp(p[1]),
|
||||
--j&&(!(k=(g[j]&15)-(g[j-1]&017)+1)||(!(j-1)&&(8==-k)))&&longjmp(p[1]),
|
||||
s+=3*!j|!(++i^17),
|
||||
(j*=i*=4)&&(i=1),
|
||||
setjmp(p[3]),
|
||||
5-j<2&&(j=0,
|
||||
setjmp(p[1]),
|
||||
5-i>j&&((g[j]^g[j+1])&0xf?g[j]^=g[j]:(s+=((g[j]&0xf)>8&&f++,
|
||||
!!g[j]*i)),
|
||||
j++,
|
||||
longjmp(p[1])),
|
||||
i++,
|
||||
longjmp(p[3])),
|
||||
s=1^s?"AACEDJQZHello World"[s]-'A':!!f,
|
||||
s+=(!i)*(6+12*s-!!s*(g[2]&017^0xa?8:-192)),
|
||||
s--,
|
||||
s*=b,
|
||||
printf("$%d (%d) \n",
|
||||
c+=s,
|
||||
s+b),
|
||||
i=0,
|
||||
setjmp(p[0]),
|
||||
6>i&&(j=1,
|
||||
setjmp(p[1]),
|
||||
0<=j&&(e[i+j]^=*(i-j+e+(j<<1)),
|
||||
--j,
|
||||
longjmp(p[1])),
|
||||
i+=++i,
|
||||
longjmp(p[0])),
|
||||
longjmp(p[2])));
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
X=1024; Y=768; A=3;
|
||||
|
||||
J=0;K=-10;L=-7;M=1296;N=36;O=255;P=9;_=1<<15;E;S;C;D;F(b){E="1""111886:6:??AAF"
|
||||
"FHHMMOO55557799@@>>>BBBGGIIKK"[b]-64;C="C@=::C@@==@=:C@=:C@=:C5""31/513/5131/"
|
||||
"31/531/53"[b ]-64;S=b<22?9:0;D=2;}I(x,Y,X){Y?(X^=Y,X*X>x?(X^=Y):0, I (x,Y/2,X
|
||||
)):(E=X); }H(x){I(x, _,0);}p;q( c,x,y,z,k,l,m,a, b){F(c
|
||||
);x-=E*M ;y-=S*M ;z-=C*M ;b=x* x/M+ y*y/M+z
|
||||
*z/M-D*D *M;a=-x *k/M -y*l/M-z *m/M; p=((b=a*a/M-
|
||||
b)>=0?(I (b*M,_ ,0),b =E, a+(a>b ?-b:b)): -1.0);}Z;W;o
|
||||
(c,x,y, z,k,l, m,a){Z=! c? -1:Z;c <44?(q(c,x ,y,z,k,
|
||||
l,m,0,0 ),(p> 0&&c!= a&& (p<W ||Z<0) )?(W=
|
||||
p,Z=c): 0,o(c+ 1, x,y,z, k,l, m,a)):0 ;}Q;T;
|
||||
U;u;v;w ;n(e,f,g, h,i,j,d,a, b,V){o(0 ,e,f,g,h,i,j,a);d>0
|
||||
&&Z>=0? (e+=h*W/M,f+=i*W/M,g+=j*W/M,F(Z),u=e-E*M,v=f-S*M,w=g-C*M,b=(-2*u-2*v+w)
|
||||
/3,H(u*u+v*v+w*w),b/=D,b*=b,b*=200,b/=(M*M),V=Z,E!=0?(u=-u*M/E,v=-v*M/E,w=-w*M/
|
||||
E):0,E=(h*u+i*v+j*w)/M,h-=u*E/(M/2),i-=v*E/(M/2),j-=w*E/(M/2),n(e,f,g,h,i,j,d-1
|
||||
,Z,0,0),Q/=2,T/=2, U/=2,V=V<22?7: (V<30?1:(V<38?2:(V<44?4:(V==44?6:3))))
|
||||
,Q+=V&1?b:0,T +=V&2?b :0,U+=V &4?b:0) :(d==P?(g+=2
|
||||
,j=g>0?g/8:g/ 20):0,j >0?(U= j *j/M,Q =255- 250*U/M,T=255
|
||||
-150*U/M,U=255 -100 *U/M):(U =j*j /M,U<M /5?(Q=255-210*U
|
||||
/M,T=255-435*U /M,U=255 -720* U/M):(U -=M/5,Q=213-110*U
|
||||
/M,T=168-113*U / M,U=111 -85*U/M) ),d!=P?(Q/=2,T/=2
|
||||
,U/=2):0);Q=Q< 0?0: Q>O? O: Q;T=T<0? 0:T>O?O:T;U=U<0?0:
|
||||
U>O?O:U;}R;G;B ;t(x,y ,a, b){n(M*J+M *40*(A*x +a)/X/A-M*20,M*K,M
|
||||
*L-M*30*(A*y+b)/Y/A+M*15,0,M,0,P, -1,0,0);R+=Q ;G+=T;B +=U;++a<A?t(x,y,a,
|
||||
b):(++b<A?t(x,y,0,b):0);}r(x,y){R=G=B=0;t(x,y,0,0);x<X?(printf("%c%c%c",R/A/A,G
|
||||
/A/A,B/A/A),r(x+1,y)):0;}s(y){r(0,--y?s(y),y:y);}main(){printf("P6\n%i %i\n255"
|
||||
"\n",X,Y);s(Y);}
|
||||
@@ -0,0 +1,68 @@
|
||||
Best Use of Light and Spheres:
|
||||
|
||||
Anders Gavare
|
||||
Gibraltargatan 82-156
|
||||
SE-412 79 Gothenburg
|
||||
Sweden
|
||||
|
||||
http://www.mdstud.chalmers.se/~md1gavan/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make gavare
|
||||
|
||||
To run:
|
||||
|
||||
./gavare > ioccc_ray.ppm
|
||||
|
||||
For users of systems that distinguish between text and binary mode
|
||||
(you know who you are), add a library call that specifies binary mode
|
||||
for stdout as the first statement of main(),
|
||||
or use freopen("ioccc_ray.ppm", "wb", stdout) and do not use redirection.
|
||||
|
||||
A freely distributable command-line version of Microsoft Visual C
|
||||
exhibits an optimizer bug when compiling this entry. Disable /Og for
|
||||
best results.
|
||||
|
||||
The judges were able to figure out how to control position
|
||||
(in all 3 coordinates), size, and color (to some extent) of the balls.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
|
||||
It is possible to write some kinds of programs in C without using reserved
|
||||
words. For very short and trivial programs, it usually isn't very hard to
|
||||
write a variant using no reserved words, but with this program I want to
|
||||
show that also non-trivial programs can be written this way. This IOCCC
|
||||
entry contains no reserved words (I don't count 'main' as a reserved word,
|
||||
although the compiler gives it special meaning) and no preprocessor
|
||||
directives.
|
||||
|
||||
The program is a small ray-tracer. The first line of the source code may
|
||||
be modified if you want the resulting image to be of some other resolution
|
||||
than the predefined. The 'A' value is an anti-alias factor. Setting it to
|
||||
1 disables the anti-aliasing feature (this makes the output look bad), but
|
||||
setting it too high makes the trace take a lot more time to complete.
|
||||
|
||||
The ppm image can then be viewed using an image viewer of your own choice.
|
||||
(Running the ray-tracer may take several minutes, even on fast machines,
|
||||
so be patient.)
|
||||
|
||||
I am very much aware about the fact that I'm breaking the guidelines. For
|
||||
example, the word 'int' is a reserved word and therefore all variable
|
||||
declarations are implicit. There will no doubt be _lots_ of warnings,
|
||||
no matter which compiler is used. Still, the source code should be word-
|
||||
length-independent and endianess-independent.
|
||||
|
||||
<humor>
|
||||
Another reason for writing code without using reserved words is that many
|
||||
text editors will make all reserved words turn BOLD when printed on
|
||||
paper. Since I care for the global environment, we shouldn't waste any
|
||||
more laser toner, or ink, than necessary. Everyone should write C code
|
||||
with no reserved words, and our world will be a better place.
|
||||
</humor>
|
||||
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
#define G(n) int n(int t, int q, int d)
|
||||
#define X(p,t,s) (p>=t&&p<(t+s)&&(p-(t)&1023)<(s&1023))
|
||||
#define U(m) *((signed char *)(m))
|
||||
#define F if(!--q){
|
||||
#define I(s) (int)main-(int)s
|
||||
#define P(s,c,k) for(h=0; h>>14==0; h+=129)Y(16*c+h/1024+Y(V+36))&128>>(h&7)?U(s+(h&15367))=k:k
|
||||
|
||||
G (B)
|
||||
{
|
||||
Z;
|
||||
F D = E (Y (V), C = E (Y (V), Y (t + 4) + 3, 4, 0), 2, 0);
|
||||
Y (t + 12) = Y (t + 20) = i;
|
||||
Y (t + 24) = 1;
|
||||
Y (t + 28) = t;
|
||||
Y (t + 16) = 442890;
|
||||
Y (t + 28) = d = E (Y (V), s = D * 8 + 1664, 1, 0);
|
||||
for (p = 0; j < s; j++, p++)
|
||||
U (d + j) = i == D | j < p ? p--, 0 : (n = U (C + 512 + i++)) < ' ' ? p |=
|
||||
n * 56 - 497, 0 : n;
|
||||
}
|
||||
|
||||
n = Y (Y (t + 4)) & 1;
|
||||
F
|
||||
U (Y (t + 28) + 1536) |=
|
||||
62 & -n;
|
||||
M
|
||||
U (d + D) =
|
||||
X (D, Y (t + 12) + 26628, 412162) ? X (D, Y (t + 12) + 27653,
|
||||
410112) ? 31 : 0 : U (d + D);
|
||||
for (; j < 12800; j += 8)
|
||||
P (d + 27653 + Y (t + 12) + ' ' * (j & ~511) + j % 512,
|
||||
U (Y (t + 28) + j / 8 + 64 * Y (t + 20)), 0);
|
||||
}
|
||||
|
||||
F if (n)
|
||||
{
|
||||
D = Y (t + 28);
|
||||
if (d - 10)
|
||||
U (++Y (t + 24) + D + 1535) = d;
|
||||
else
|
||||
{
|
||||
for (i = D; i < D + 1600; i++)
|
||||
U (i) = U (i + 64);
|
||||
Y (t + 24) = 1;
|
||||
E (Y (V), i - 127, 3, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
Y (t + 20) += ((d >> 4) ^ (d >> 5)) - 3;
|
||||
}
|
||||
}
|
||||
|
||||
G (_);
|
||||
G (o);
|
||||
G (main)
|
||||
{
|
||||
Z, k = K;
|
||||
if (!t)
|
||||
{
|
||||
Y (V) = V + 208 - (I (_));
|
||||
L (209, 223) L (168, 0) L (212, 244) _((int) &s, 3, 0);
|
||||
for (; 1;)
|
||||
R n = Y (V - 12);
|
||||
if (C & ' ')
|
||||
{
|
||||
k++;
|
||||
k %= 3;
|
||||
if (k < 2)
|
||||
{
|
||||
Y (j) -= p;
|
||||
Y (j) += p += U (&D) * (1 - k * 1025);
|
||||
if (k)
|
||||
goto y;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (C = V - 20;
|
||||
!i && D & 1 && n
|
||||
&& (X (p, Y (n + 12), Y (n + 16)) ? j = n + 12, Y (C + 8) =
|
||||
Y (n + 8), Y (n + 8) = Y (V - 12), Y (V - 12) =
|
||||
n, 0 : n); C = n, n = Y (n + 8));
|
||||
i = D & 1;
|
||||
j &= -i;
|
||||
}
|
||||
}
|
||||
else if (128 & ~D)
|
||||
{
|
||||
E (Y (n), n, 3, U (V + D % 64 + 131) ^ 32);
|
||||
n = Y (V - 12);
|
||||
y:C = 1 << 24;
|
||||
M U (C + D) = 125;
|
||||
o (n, 0, C);
|
||||
P (C + p - 8196, 88, 0);
|
||||
M U (Y (0x11028) + D) = U (C + D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (D = 720; D > -3888; D--)
|
||||
putchar (D >
|
||||
0 ?
|
||||
" )!\320\234\360\256\370\256 0\230F .,mnbvcxz ;lkjhgfdsa \n][poiuytrewq =-0987654321 \357\262 \337\337 \357\272 \337\337 ( )\"\343\312F\320!/ !\230 26!/\16 K>!/\16\332 \4\16\251\0160\355&\2271\20\2300\355`x{0\355\347\2560 \237qpa%\231o!\230 \337\337\337 , )\"K\240 \343\316qrpxzy\0 sRDh\16\313\212u\343\314qrzy !0( "
|
||||
[D] ^ 32 : Y (I (D)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
G (o)
|
||||
{
|
||||
Z;
|
||||
if (t)
|
||||
{
|
||||
C = Y (t + 12);
|
||||
j = Y (t + 16);
|
||||
o (Y (t + 8), 0, d);
|
||||
M U (d + D) =
|
||||
X (D, C, j) ? X (D, C + 1025, j - 2050) ? X (D, C + 2050,
|
||||
j - 3075) ? X (D,
|
||||
C + 2050,
|
||||
j -
|
||||
4100) ?
|
||||
X (D, C + 4100,
|
||||
((j & 1023) + 18424)) ? 176 : 24 : 20 : 28 : 0 : U (d + D);
|
||||
for (n = Y (t + 4); U (i + n); i++)
|
||||
P (d + Y (t + 12) + 5126 + i * 8, U (n + i), 31);
|
||||
E (Y (t), t, 2, d);
|
||||
}
|
||||
}
|
||||
|
||||
G (_)
|
||||
{
|
||||
Z = Y (V + 24);
|
||||
F Y (V - 16) += t;
|
||||
D = Y (V - 16) - t;
|
||||
}
|
||||
|
||||
F for (i = 124; i < 135; i++)
|
||||
D = D << 3 | Y (t + i) & 7;
|
||||
}
|
||||
|
||||
if (q > 0)
|
||||
{
|
||||
for (; n = U (D + i); i++)
|
||||
if (n - U (t + i))
|
||||
{
|
||||
D += _(D, 2, 0) + 1023 & ~511;
|
||||
i = ~0;
|
||||
}
|
||||
F if (Y (D))
|
||||
{
|
||||
n = _(164, 1, 0);
|
||||
Y (n + 8) = Y (V - 12);
|
||||
Y (V - 12) = n;
|
||||
Y (n + 4) = i = n + 64;
|
||||
for (; j < 96; j++)
|
||||
Y (i + j) = Y (t + j);
|
||||
i = D + 512;
|
||||
j = i + Y (i + 32);
|
||||
for (; Y (j + 12) != Y (i + 24); j += 40);
|
||||
E (Y (n) = Y (j + 16) + i, n, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return D;
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
Best of Show:
|
||||
|
||||
Gavin Barraclough
|
||||
Flat 20, 83 Newton Street,
|
||||
Manchester,
|
||||
M1 1EP,
|
||||
U.K.
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build and run (on any platform, without root privileges):
|
||||
|
||||
make gavin
|
||||
|
||||
To enjoy the results (on a Linux/x86 machine):
|
||||
|
||||
su
|
||||
|
||||
# Make a floppy with an ext2 filesystem (mke2fs /dev/fd0),
|
||||
# mount it under /mnt/floppy
|
||||
|
||||
cp kernel fs.tar lilo.conf boot.b /mnt/floppy
|
||||
|
||||
# If the version of your lilo is not 21.4, use the appropriate boot.b
|
||||
# If your floppy drive is not /dev/fd0, edit lilo.conf appropriately
|
||||
|
||||
lilo -C /mnt/floppy/lilo.conf
|
||||
|
||||
# Boot from the floppy on an x86 machine with a PS/2 keyboard and mouse
|
||||
# Move the window away from the corner
|
||||
|
||||
vi gavin.c
|
||||
|
||||
# Scroll the file with up-arrow and down-arrow
|
||||
|
||||
sh
|
||||
|
||||
# Can have several shell windows
|
||||
|
||||
vi gavin.hint
|
||||
prim
|
||||
|
||||
# Press and hold any key
|
||||
|
||||
Over the years, we've seen a program that dumps core
|
||||
if executed on a "wrong" architecture immediately (1984/mullender),
|
||||
or after a while (2001/bellard). This entry will happily compile and
|
||||
execute on any architecture - the trick is that the result, to be useful,
|
||||
must be produced (and can only be enjoyed) on a particular architecture.
|
||||
We have not decided yet whether to disallow this for future contests.
|
||||
|
||||
If you do not want to mess with a floppy and you use GRUB, see below
|
||||
in the author's notes.
|
||||
You can put additional text files in fs.tar for browsing with vi.
|
||||
If you do not want to bother rebooting your computer at all,
|
||||
see http://bellard.org/ for QEMU (Fabrice Bellard is an IOCCC 2001 winner),
|
||||
but your experience will be limited (replace -DK=0 with -DK=1 in the Makefile,
|
||||
and you will have to move the mouse to trigger the initial screen update).
|
||||
|
||||
The judges were able to write a few more programs to run on this OS
|
||||
What are the limitations for such programs?
|
||||
What you can do and what you cannot do in such programs?
|
||||
|
||||
The program called "prim", written by the judges,
|
||||
computes and prints prime numbers.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This is a 32-bit multitasking operating system for x86 computers,
|
||||
with GUI and filesystem, support for loading and executing user
|
||||
applications in elf binary format, with ps2 mouse and keyboard drivers,
|
||||
and vesa graphics. And a command shell. And an application -
|
||||
a simple text-file viewer.
|
||||
|
||||
The OS has ended up as a traditional monolith with one entry point
|
||||
for syscalls, with apps treated as cooperative-multitasking tasks
|
||||
that can be sent different messages (e.g. 'initialize', 'key hit',
|
||||
'render to buffer') through their main entry point, and which will
|
||||
return control to the OS having performed the necessary work.
|
||||
Applications are are passed a pointer to their task structure,
|
||||
which is partially defined by the OS, and partially for
|
||||
the application's own use.
|
||||
|
||||
The program compiles into a tool to build a kernel image,
|
||||
so having built the program, the makefile will run it,
|
||||
piping the output into a file called 'kernel'.
|
||||
The makefile will then proceed to build a root filesystem image.
|
||||
This involves rebuilding the program with different compiler flags,
|
||||
then building a tar file containing the resulting programs
|
||||
(the filesystem format supported by the OS is the tar-file format).
|
||||
|
||||
For further usage information see 'gavin_install.txt'.
|
||||
|
||||
The filenames 'vi' and 'sh' are significant, and should not be changed.
|
||||
|
||||
Known 'features'.
|
||||
|
||||
Known issues are really too plentiful to list.
|
||||
|
||||
If the mouse pointer goes off the left hand side of the screen
|
||||
it will reappear on the right, and vice-versa.
|
||||
If it goes off the top or bottom, it will go and corrupt some memory.
|
||||
|
||||
The file system is kinda optimistic about matching names, so,
|
||||
for example if you type the command 'shell' into a command-line
|
||||
it will execute the program 'sh' - close enough a match for it.
|
||||
|
||||
The elf binaries are not loaded at the correct address,
|
||||
and their entry point must be the start address of the text segment.
|
||||
|
||||
The keyboard driver can cope with the basic alpha-numeric keys,
|
||||
but gets confused by fancy things like 'shift' or 'backspace'.
|
||||
|
||||
In the text-file viewer, 'vi', the up/down and pgup/pgdn keys
|
||||
scroll up or down by one line. There is nothing to stop you
|
||||
[from] scrolling above the top of the file, and pressing any
|
||||
other keys may have an undefined effect.
|
||||
|
||||
The x86 is bootstrapped into 32bit mode in 6 instructions,
|
||||
with 4 more to set up data/stack segments and a stack-pointer
|
||||
to allow C code to be run. On top of this there are also about
|
||||
a dozen instructions to switch the video card into graphics mode.
|
||||
All in all, a relatively tiny number of instructions next to
|
||||
the size of the C program. Also, the string is mostly composed
|
||||
of data - a Linux-esque kernel header for the bootloader,
|
||||
protected mode descriptor tables, keyboard maps, etc.
|
||||
(I should also mention that it contains mini functions
|
||||
to perform an x86 'in' and 'out' instruction - to allow
|
||||
the keyboard & mouse to be driven from C code).
|
||||
|
||||
Porting to another architecture should be relatively easy* -
|
||||
the string simply needs be replaced with one containing
|
||||
data & code suitable for the new target platform.
|
||||
Accesses to data in the string are made relative to the define 'V',
|
||||
so these may need updating as appropriate (0x90200 is the address
|
||||
at which a Linux bootloader loads an x86 kernel image).
|
||||
|
||||
* ;-)
|
||||
@@ -0,0 +1,16 @@
|
||||
1) First, build the kernel and filesystem (just 'make'). In short, you need to build this on an x86 Linux machine. If you wish to try to compile on an OS other than Linux you may need modify the makefile to compile 'sh' using a cross-compiler that produces elf binaries - i.e. a cross-compiler targeting x86 Linux. In short, you need to build this on an x86 Linux machine.
|
||||
|
||||
2) Next, find a suitable machine to run the OS on. It should be perfectly safe, and since it does not directly attempt to access any hard disk drives (only a ramdisk loaded by the bootloader) it should do no damage to your existing setup, BUT I ACCEPT NO LIABILITY FOR ANY DAMAGE DONE BY THIS PROGRAM. Run it at your own risk. The OS has been tested on half a dozen machines or so, and worked on all but one. The failure came in the form of the machine rebooting itself midway through loading the OS, with no nasty side-effects.
|
||||
|
||||
Hardware requirements - i386 or better processor, but the GUI is surprisingly power-hungry, so I would recommend a fast p3 or p4 processor (has been tested on p3/p4/athlon machines). Minimum RAM is something like 32MB. PS2 mouse & keyboard required - no USB I'm afraid, and the keyboard map is for a UK keyboard. Uses Vesa VBE 3.0, so should work on any modern graphics card (has been tested on Nvidia, Matrox, and SiS cards).
|
||||
|
||||
3) Now you need to setup a bootloader to load the OS. If you have a system using a lilo bootloader you can simply add the OS to your boot menu. Just add appropriate "image=" and "initrd=" lines to your /etc/lilo.conf, pointing at 'kernel' and 'fs.tar' respectively (as built by make earlier), then run lilo. If you do not wish modify your lilo setup, one easy option is to get yourself a grub bootdisk image, and follow the instructions for grub below - debian users can simple "apt-get install grub-disk" to get themselves a grub bootdisk.
|
||||
|
||||
If you run grub, then at the boot menu simply hit 'c' to get a console, then type "kernel=(hd0,0)/<PATH>/kernel" (substituting appropriate harddrive/partition numbers & path, or using "(fd0)" to load a kernel on the floppy), then "initrd=(hd0,0)/<PATH>/fs.tar", and finally "boot".
|
||||
|
||||
4) Assuming the OS has booted, what can you do now? Well, start by trying "sh", to open another shell. Then, try "vi prog.c" (although this file may have been re-named...), to open up the OS source in a text file viewer (up/down or pgup/pgdown to scroll). [Note that the provided applications, 'sh' and 'vi' both have windows of the same size, and that open in the top left corner of the screen, so you may need drag the windows around a bit to tell them apart.]
|
||||
|
||||
5) To shut down - just hit the power button. :-)
|
||||
|
||||
|
||||
|
||||
+547
@@ -0,0 +1,547 @@
|
||||
17th International Obfuscated C Code Contest Guidelines, Hints and Comments
|
||||
|
||||
Copyright (C) 2004 Leonid A. Broukhis, Simon Cooper, Landon Curt Noll and
|
||||
Peter Seebach.
|
||||
|
||||
All Rights Reserved. Permission for personal, education 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 the contest judges.
|
||||
|
||||
|
||||
ABOUT THIS FILE:
|
||||
|
||||
This file contains guidelines intended to help people who wish to
|
||||
submit entries to the International Obfuscated C Code Contest (IOCCC
|
||||
for short).
|
||||
|
||||
This is not the IOCCC rules, though it does contain comments about
|
||||
them. The guidelines should be viewed as hints and suggestions.
|
||||
Entries that violate the guidelines but remain within the rules are
|
||||
allowed. Even so, you are safer if you remain within the guidelines.
|
||||
|
||||
You should read the current IOCCC rules, prior to submitting entries.
|
||||
The rules are typically sent out with these guidelines.
|
||||
|
||||
WHAT'S NEW IN 2004:
|
||||
|
||||
The contest runs from 07-Jan-2004 00:00 UTC to 29-Feb-2004 23:59:59 UTC
|
||||
|
||||
An online submission mechanism will be available after
|
||||
26-Jan-2004, 00:00 UTC. See the following for details,
|
||||
|
||||
http://www.ioccc.org/2004/submit
|
||||
|
||||
HINTS AND SUGGESTIONS:
|
||||
|
||||
You are encouraged to examine the winners of previous contests. See
|
||||
FOR MORE INFORMATION for details on how to get previous winners.
|
||||
|
||||
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.
|
||||
|
||||
An entry is usually examined in a number of ways. We typically apply
|
||||
a number of tests to an entry:
|
||||
|
||||
* look at the original source
|
||||
* convert ANSI tri-graphs to ASCII
|
||||
* C pre-process the source ignoring '#include' lines
|
||||
* C pre-process the source ignoring '#define' and '#include' lines
|
||||
* run it through a C beautifier
|
||||
* examine the algorithm
|
||||
* compile it (with flags to enable all warnings)
|
||||
* execute it
|
||||
|
||||
You should consider how your entry looks in each of the above tests.
|
||||
You should ask yourself if your entry remains obscure after it has been
|
||||
'cleaned up' by the C pre-processor and a C beautifier.
|
||||
|
||||
Your entry need not pass all of the above tests. In certain
|
||||
cases, a test is not important. Entries that compete for the
|
||||
'strangest/most creative source layout' need not do as well as
|
||||
others in terms of their algorithm. On the other hand, given
|
||||
two such entries, we are more inclined to pick the entry that
|
||||
does something interesting when you run it.
|
||||
|
||||
We try to avoid limiting creativity in our rules. As such, we leave
|
||||
the contest open for creative rule interpretation. As in real life
|
||||
programming, interpreting a requirements document or a customer request
|
||||
is important. For this reason, we often award 'worst abuse of the
|
||||
rules' to an entry that illustrates this point in an ironic way.
|
||||
|
||||
We do realize that there are holes in the rules, and invite entries
|
||||
to attempt to exploit them. We will award 'worst abuse of the rules'
|
||||
and then plug the hole next year. Even so, we will attempt to use
|
||||
the smallest plug needed, if not smaller. :-)
|
||||
|
||||
Check out your program and be sure that it works. We sometimes make
|
||||
the effort to debug an entry that has a slight problem, particularly
|
||||
in or near the final round. On the other hand, we have seen some
|
||||
of the best entries fall down because they didn't work.
|
||||
|
||||
We tend to look down on a prime number printer, that claims that
|
||||
16 is a prime number. If you do have a bug, you are better off
|
||||
documenting it. Noting "this entry sometimes prints the 4th power
|
||||
of a prime by mistake" would save the above entry. And sometimes,
|
||||
a strange bug/feature can even help the entry! Of course, a correctly
|
||||
working entry is best.
|
||||
|
||||
People who are considering to just use some complex mathematical
|
||||
function or state machine to spell out something such as "hello,
|
||||
world!" may want to try and be more creative.
|
||||
|
||||
Ultra-obfuscated programs are in some cases some cases easier to
|
||||
deobfuscate than subtly-obfuscated programs. Consider using
|
||||
misleading or subtle tricks layered on top of or under an
|
||||
appropriate level of obfuscation.
|
||||
|
||||
Programs that use VTxxx/ANSI sequences that are NOT limited to a
|
||||
specific terminal brand and that can also work in a standard xterm
|
||||
are considered portable.
|
||||
|
||||
|
||||
OUR LIKES AND DISLIKES:
|
||||
|
||||
Doing masses of #defines to obscure the source has become 'old'. We
|
||||
tend to 'see thru' masses of #defines due to our pre-processor tests
|
||||
that we apply. Simply abusing #defines or -Dfoo=bar won't go as far
|
||||
as a program that is more well rounded in confusion.
|
||||
|
||||
Many ANSI C compilers dislike the following code, and so do we:
|
||||
|
||||
#define d define
|
||||
#d foo <-- don't expect this to turn into #define foo
|
||||
|
||||
When declaring local or global variables, you should declare the type:
|
||||
|
||||
int this_is_ok;
|
||||
this_is_not; <-- don't use such implicit type declarations
|
||||
|
||||
We suggest that you compile your entry with an ANSI C compiler. If you
|
||||
must use non-ANSI C, such as K&R C, you must avoid areas that result in
|
||||
compile/link errors for ANSI C compilers. For example, using gcc
|
||||
local function declarations, such as:
|
||||
|
||||
int
|
||||
main() {
|
||||
void blah() { printf("blah\n"); }
|
||||
blah();
|
||||
}
|
||||
|
||||
are not allowed even though their existence seems tailor made for
|
||||
this contest! But for now, since they are not in wide spread use
|
||||
we cannot accept entries that use them.
|
||||
|
||||
If your entry uses functions that have a variable number of
|
||||
arguments, be careful. Systems implement va_list as a wide variety
|
||||
of ways. Because of this, a number of operations using va_list are
|
||||
not portable and must not be used:
|
||||
|
||||
* assigning a non-va_list variable to/from a va_list variable
|
||||
* casting a non-va_list variable into/from a va_list variable
|
||||
* passing a va_list variable to a function expecting a non-va_list arg
|
||||
* passing a non-va_list variable to a function expecting a va_list arg
|
||||
* performing arithmetic on va_list variables
|
||||
* using va_list as a structure or union
|
||||
|
||||
In particular, do not treat va_list variables as if they were a char **'s.
|
||||
|
||||
Avoid using <varargs.h>. Use <stdarg.h> instead.
|
||||
|
||||
If you use C preprocessor directives (#define, #if, #ifdef, ...),
|
||||
the leading '#' must be the first non-whitespace character on a line.
|
||||
While some broken C preprocessors do not allow whitespace before a
|
||||
'#', most do.
|
||||
|
||||
The exit() function returns void. On some broken systems have exit()
|
||||
return int. Your entry should assume that exit() returns a void.
|
||||
|
||||
Small programs are best when they are short, obscure and concise.
|
||||
While such programs are not as complex as other winners, they do
|
||||
serve a useful purpose. They are often the only program that people
|
||||
attempt to completely understand. For this reason, we look for
|
||||
programs that are compact, and are instructional.
|
||||
|
||||
One line programs should be short one line programs, say around 80
|
||||
bytes long. Getting close to 160 bytes is a bit too long in our opinion.
|
||||
|
||||
We tend to dislike programs that:
|
||||
|
||||
* are very hardware specific
|
||||
* are very OS 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 or run under a POSIX P1003.1/P1003.2 like systems
|
||||
* depend on a utility or application not normally found on most
|
||||
most POSIX P1003.1/P1003.2 like systems
|
||||
* abuse the build file to get around the size limit
|
||||
* obfuscate by excessive use of ANSI tri-graphs
|
||||
* are longer than they need to be
|
||||
* are similar to previous winners
|
||||
* are identical to previous losers :-)
|
||||
|
||||
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.
|
||||
|
||||
The build file should not be used to try and get around the size
|
||||
limit. It is one thing to make use of a several -D's to help out,
|
||||
but it is quite another to use 200+ bytes of -D's in order to
|
||||
try and squeeze the source under the size limit. You should feel
|
||||
free to make use of the build file space, but you are better off
|
||||
if you show some amount of restraint.
|
||||
|
||||
You should try to restrict commands used on the build file to
|
||||
POSIX-like or common Un*x-like commands. You can also compile
|
||||
and use your own programs. If you do, try to build and execute
|
||||
from the current directory. This restriction is not a hard and
|
||||
absolute one. The intent is to ensure that the building if your
|
||||
program is reasonably portable.
|
||||
|
||||
Don't forget that the building of your program should be done
|
||||
***without human intervention***. So don't do:
|
||||
|
||||
cat > prog.c
|
||||
cc prog.c -o prog
|
||||
|
||||
However, you can do something cute such as making your program
|
||||
do something dumb (or cute) when build 'automatically'. However
|
||||
when it is run with a human involved, do something more clever.
|
||||
For example, one could use the build instructions:
|
||||
|
||||
cc prog.c -DNONHUMAN -o prog
|
||||
echo "See remarks section about alternate ways to compile"
|
||||
|
||||
and then include special notes in the program "remarks" for
|
||||
alternate / human intervention based building.
|
||||
|
||||
We want to get away from source that is simply a compact blob of
|
||||
characters. To help, we give a break to source that contains
|
||||
whitespace, and in certain cases ; { or } characters. While the
|
||||
number of characters excluding whitespace (tab, space, newline),
|
||||
and excluding any ; { or } followed immediately by either whitespace
|
||||
or end of file, must be <= 2048, the total size may be less than 4096
|
||||
bytes. This means that one may use "free of charge" up to 2048
|
||||
bytes of whitespace, or ; { or } followed by either whitespace
|
||||
or end of file.
|
||||
|
||||
Please do not use things like gzip to get around the size limit.
|
||||
|
||||
Given two versions of the same program, one that is a compact blob
|
||||
of code, and the other that is formatted more like a typical C
|
||||
program, we tend to favor the second version. Of course, a third
|
||||
version of the same program that is formatted in an interesting
|
||||
and/or obfuscated way, would definitely win over the first two!
|
||||
|
||||
We suggest that you avoid trying for the 'smallest self-replicating'
|
||||
source. The smallest, a zero byte entry, won in 1994.
|
||||
|
||||
We do not like writable strings. That is, we don't want stuff like:
|
||||
|
||||
char *T = "So many primes, so little time!";
|
||||
...
|
||||
T[14] = ';';
|
||||
|
||||
Please don't make use of this feature, even if your system allows it.
|
||||
However, initialized char arrays are OK to write over. This is OK:
|
||||
|
||||
char b[] = "Is this Ok";
|
||||
b[9] = 'K';
|
||||
|
||||
X client entries should be as portable as possible. Entries that
|
||||
adapt to a wide collection of environments will be favored. Don't
|
||||
depend on a particular type of display. For example, don't depend
|
||||
on color or a given size. Don't require backing store.
|
||||
|
||||
X client entries should avoid using X related libraries and
|
||||
software that is not in wide spread use.
|
||||
|
||||
We don't like entries that use proprietary M*tif, Xv*ew, or OpenL*ok
|
||||
toolkits, since not everyone has them. Use of OpenMotif is permitted
|
||||
because it is more widely and freely available.
|
||||
|
||||
You should avoid depending on a particular window manager.
|
||||
|
||||
X client entries should not to depend on particular items on
|
||||
.Xdefaults. If you must do so, be sure to note the required lines
|
||||
in the program "remarks".
|
||||
|
||||
While we recognize that UN*X is not a universal operating system, the
|
||||
contest does have a bias towards such systems. In an effort to expand
|
||||
the scope of the contest, we phrase our bias in terms of POSIX P1003.1
|
||||
and P1003.2 standards. This will allow certain non-UN*X OS users to
|
||||
submit entries. On the other hand, this is a guideline and not a rule.
|
||||
We will not reject an entry based on some POSIX technicality.
|
||||
|
||||
When dealing with OS and application environments, we suggest that you
|
||||
be reasonable with a nod towards vanilla UN*X-like systems. POSIX will
|
||||
evolve but not as much as the contest, so avoid stuff like POSIX real
|
||||
time, security, etc.
|
||||
|
||||
We like programs that:
|
||||
|
||||
* are as concise and small as they need to be
|
||||
* do something at least quasi-interesting
|
||||
* are portable
|
||||
* are unique or novel in their obfuscation style
|
||||
* MAKE USE OF A NUMBER OF DIFFERENT TYPES OF OBFUSCATION <== HINT!!
|
||||
* make us laugh and/or throw up :-) (humor helps!)
|
||||
|
||||
Some types of programs can't excel (tm) in some areas. Of course, your
|
||||
program doesn't have to excel in all areas, but doing well in several
|
||||
areas really does help.
|
||||
|
||||
You are better off explaining what your entry does in the program
|
||||
"remarks" section rather than leaving it obscure for the judges
|
||||
as we might miss something and/or be too tired to notice.
|
||||
|
||||
We freely admit that interesting, creative or humorous comments in
|
||||
the program "remarks" help your chances of winning. If you had to
|
||||
read so many twisted entries, you too would enjoy a good laugh or two.
|
||||
We think the readers of the contest winners do as well. We do read
|
||||
the program "remarks" during the judging process, so it is worth your
|
||||
while to write remarkable program "remarks".
|
||||
|
||||
We dislike C code with trailing control-M's (\r or \015) that results
|
||||
in compilation failures. Some non-Un*x/non-Linux tools such as
|
||||
MS Visual C and MS Visual C++ leave trailing control-M's on lines.
|
||||
Users of such tools should strip off such control-M's before submitting
|
||||
their entries. In some cases tools have a "Save As" option that will
|
||||
prevent such trailing control-M's being added.
|
||||
|
||||
We dislike entries that depend on non-portable libcurses features such
|
||||
as halfdelay(). One should restrict libcurses to portable features
|
||||
found on BSD and SVR4/System V curses.
|
||||
|
||||
The rules disallow source that contains unescaped octets with values
|
||||
between 128 and 255. You must use \octal or \hex escapes instead:
|
||||
|
||||
/* 123456789 123456789 123456789 123456 */
|
||||
char *foo = "This string is 36 octets in length \263";
|
||||
/* This octet requires 4 octets of source ^^^^ */
|
||||
if (strlen(foo) == 36) printf("foo is 36 octets a final NUL\n");
|
||||
|
||||
Be creative!
|
||||
|
||||
|
||||
ABUSING THE RULES:
|
||||
|
||||
Legal abuse of the rules is somewhat encouraged. Legal rule abuse may
|
||||
involve, but is not limited to, doing things that are technically
|
||||
allowed by the rules and yet do not fit the spirit of what we intended
|
||||
to be submitted.
|
||||
|
||||
Legal rule abuse is encouraged to help promote creativity. Rule abuse
|
||||
entries, regardless of if they receive an award, result in changes to
|
||||
the next year's rules and guidelines.
|
||||
|
||||
Legal abuse of the rules is NOT an invitation to violate the rules.
|
||||
An entry that violates the rules in the opinion of the judges, WILL be
|
||||
disqualified. RULE ABUSE CARRIES A CERTAIN LEVEL OF RISK! If you
|
||||
have an entry that might otherwise be interesting, you might want to
|
||||
submit two versions; one that does not abuse the rules and one that
|
||||
does.
|
||||
|
||||
If you intend to abuse the rules, indicate so in the program
|
||||
"remarks". You must try to justify why you consider your rule abuse
|
||||
to be allowed under the rules. That is, you must plead your case as
|
||||
to why your entry is valid. Humor and/or creativity help plead a
|
||||
case.
|
||||
|
||||
Abusing the entry format tends to annoy us more than amuse us.
|
||||
|
||||
We are often asked why the contest rules and guidelines seem too
|
||||
strange or contain mistakes, flaws or grammatical errors. One reason
|
||||
is that we sometimes make genuine mistakes. But in many cases such
|
||||
problems, flaws or areas of confusion are deliberate. Changes to
|
||||
rules and guidelines in response to rule abuses, are done in a minimal
|
||||
fashion. Often we will deliberately leave behind holes (or introduce
|
||||
new ones) so that future rule abuse may continue.
|
||||
|
||||
At the risk of stating the obvious, this contest is a parody of the
|
||||
software development process. The rules and guidelines are only a
|
||||
small part of the overall contest. Even so, one may think the contest
|
||||
rules and guideline process as a parody of the sometimes tragic
|
||||
mismatch between what a customer (or marketing) wants and what
|
||||
engineering delivers.
|
||||
|
||||
|
||||
JUDGING PROCESS:
|
||||
|
||||
Entries are judged by Leonid A. Broukhis, Simon Cooper, Landon Curt Noll
|
||||
and Peter Seebach.
|
||||
|
||||
Each entry submitted is given an id number and subdirectory. The
|
||||
"program", "info", "build" and "remarks" portions of a submission are
|
||||
stored and judged from this directory.
|
||||
|
||||
Any "author" and identifiable "entry" information is not read until
|
||||
the judging process is complete, and then only from entries that have
|
||||
won an award.
|
||||
|
||||
The above process helps keep us biased for/against any one particular
|
||||
individual. We are usually kept in the dark as much as you are
|
||||
until the final awards are given. We like the surprise of finding
|
||||
out in the end, who won and where they were from.
|
||||
|
||||
We attempt to keep all entries anonymous, unless they win an award.
|
||||
Because the main 'prize' of winning is being announced, we make all
|
||||
attempts to send non-winners into oblivion. We remove all non-winning
|
||||
files, and shred all related paper. By tradition, we do not even
|
||||
reveal the number of entries that we received. (For the curious,
|
||||
we do indicate the volume of paper consumed when presenting the IOCCC
|
||||
winners at talks)
|
||||
|
||||
After the initial announcement, we attempt to send EMail to the
|
||||
authors of the winning entries. One reason we do this is to give
|
||||
the authors a chance to comment on the way we have presented their
|
||||
entry. They are given the chance to correct mistakes and typos. We
|
||||
often accept their suggestions/comments about our remarks as well.
|
||||
This is done prior to posting the winners to the wide world.
|
||||
|
||||
Judging consists of a number of elimination rounds. During a round,
|
||||
the collection of entries are divided into two roughly equal piles;
|
||||
the pile that advances on to the next round, and the pile that does
|
||||
not. We also re-examine the entries that were eliminated in the
|
||||
previous round. Thus, an entry gets at least two readings.
|
||||
|
||||
A reading consists of a number of actions:
|
||||
|
||||
* reading the "build" information
|
||||
* reading the "program"
|
||||
* reading the program "info", if any
|
||||
* passing the source thru the C pre-processor
|
||||
skipping over any #include files
|
||||
* performing a number of C beautify/cleanup edits on the source
|
||||
* passing the beautified source thru the C pre-processor
|
||||
skipping over any #include files
|
||||
|
||||
In later rounds, other actions are performed:
|
||||
|
||||
* compiling/building the source
|
||||
* running the program
|
||||
* performing miscellaneous tests on the source and binary
|
||||
|
||||
Until we reduce the stack of entries down to about 25 entries, entries
|
||||
are judged on an individual basis. An entry is set aside because it
|
||||
does not, in our opinion, meet the standard established by the round.
|
||||
When the number of entries thins to about 25 entries, we begin to form
|
||||
award categories. Entries begin to compete with each other for awards.
|
||||
An entry will often compete in several categories.
|
||||
|
||||
The actual award category list will vary depending on the types of entries
|
||||
we receive. A typical category list might be:
|
||||
|
||||
* best small one line program
|
||||
* best small program
|
||||
* strangest/most creative source layout
|
||||
* most useful obfuscated program
|
||||
* best game that is obfuscated
|
||||
* most creatively obfuscated program
|
||||
* most deceptive C code
|
||||
* best X client (see OUR LIKES AND DISLIKES)
|
||||
* best abuse of ANSI C
|
||||
* worst abuse of the rules
|
||||
* (anything else so strange that it deserves an award)
|
||||
|
||||
We do not limit ourselves to this list. For example, a few entries are so
|
||||
good/bad that they are declared winners at the start of the final round.
|
||||
We will invent awards categories for them, if necessary.
|
||||
|
||||
In the final round process, we perform the difficult tasks of
|
||||
reducing the remaining entries (typically about 25) down to 8 or 10
|
||||
winners. Often we are confident that the entries that make it into
|
||||
the final round are definitely better than the ones that do not
|
||||
make it. The selection of the winners out of the final round, is
|
||||
less clear cut.
|
||||
|
||||
Sometimes a final round entry os good enough to win, but is beat out
|
||||
by a similar, but slightly better entry. For this reason, it is
|
||||
sometimes worthwhile to re-enter an improved version of an entry
|
||||
that failed to win in a previous year. This assumes, of course,
|
||||
that the entry is worth improving in the first place!
|
||||
|
||||
More often than not, we select a small entry (usually one line), a
|
||||
strange/creative layout entry, and an entry that abuses the contest
|
||||
rules in some way.
|
||||
|
||||
In the end, we traditionally pick one entry as 'best'. Sometimes such
|
||||
an entry simply far exceeds any of the other entries. More often, the
|
||||
'best' is picked because it does well in a number of categories.
|
||||
|
||||
|
||||
ANNOUNCEMENT OF WINNERS:
|
||||
|
||||
The judges will post an initial announcement of who won, the name
|
||||
of their award, and a very brief description of the winning entry
|
||||
on the IOCCC web site:
|
||||
|
||||
http://www.ioccc.org/whowon.html
|
||||
|
||||
We will also submit a brief announcement story to /.:
|
||||
|
||||
http://slashdot.org
|
||||
|
||||
that, depending on the willingness of the /. editors, may be posted
|
||||
to their site at the same time.
|
||||
|
||||
Note that initial announcement will NOT contain source. This is because
|
||||
the winning authors are given a chance to review the judges comments,
|
||||
and test our Makefile. This review process typically takes a few weeks.
|
||||
|
||||
Sometime after the initial announcement, and once the the review
|
||||
by the winners has been completed, the winning source will be
|
||||
posted to the IOCCC web site:
|
||||
|
||||
http://www.ioccc.org/years.html
|
||||
|
||||
NOTE: previous winners are available at that URL
|
||||
|
||||
We will submit a story announcing the availability of the winners
|
||||
to /. at the same time.
|
||||
|
||||
Finally the winning entries will be posted to the following groups:
|
||||
|
||||
comp.lang.c comp.lang.c.moderated alt.sources
|
||||
|
||||
In addition, pointers to these postings are posted to the following
|
||||
|
||||
comp.sources.misc comp.windows.x comp.programming
|
||||
misc.misc comp.std.c alt.folklore.computers
|
||||
|
||||
Often, winning entries are published in selected magazines from around
|
||||
the world. Winners have appeared in books ("The New Hackers Dictionary")
|
||||
and on T-Shirts.
|
||||
|
||||
Last, but not least, winners receive international fame and flames! :-)
|
||||
|
||||
|
||||
FOR MORE INFORMATION:
|
||||
|
||||
You may contact the judges by sending EMail to the following address:
|
||||
|
||||
q.2004@ioccc.org (not the address for submitting entries)
|
||||
|
||||
You must include the words 'ioccc 2004 question' in the subject of your
|
||||
EMail message when sending EMail to the judges.
|
||||
|
||||
Questions and comments about the contest are welcome. Comments about
|
||||
confusing rules and guidelines are also welcome.
|
||||
|
||||
The rules and the guidelines may (and often do) change from year to
|
||||
year. You should be sure you have the current rules and guidelines
|
||||
prior to submitting entries.
|
||||
|
||||
Check out the IOCCC Web page:
|
||||
|
||||
http://www.ioccc.org
|
||||
|
||||
It has rules, guidelines and winners of previous contests (1984 to date).
|
||||
|
||||
Leonid A. Broukhis
|
||||
Simon Cooper
|
||||
chongo (Landon Curt Noll) /\cc/\
|
||||
Peter Seebach
|
||||
@@ -0,0 +1,169 @@
|
||||
Best Abuse of the Guidelines:
|
||||
|
||||
Anthony Howe
|
||||
Snert
|
||||
42 av. Isola Bella
|
||||
06400 Cannes
|
||||
France
|
||||
|
||||
http://www.snert.com/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build (simple: Cygwin, FreeBSD, Linux, Mac OS X):
|
||||
|
||||
tar -zxf hibachi.tgz
|
||||
cd hibachi
|
||||
./configure
|
||||
make
|
||||
|
||||
Try:
|
||||
|
||||
cd hibachi
|
||||
./hibachi-start.sh
|
||||
|
||||
Then use your web browser to visit http://localhost:8008/
|
||||
|
||||
This entry violates the guidelines in so many ways! We are not
|
||||
exactly sure how many org's will be upset with this entry, but we
|
||||
are considering starting an IOCCC standards body just to reign in
|
||||
the likes Mr Howe.
|
||||
|
||||
This entry also has the dubious honour of being the only one to have
|
||||
been submitted with its own ./configure script.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
README.TXT Feb 2004
|
||||
==========
|
||||
|
||||
Hibachi is a simple, small, and (probably) very secure web server.
|
||||
|
||||
There is a `hibachi.tgz' file that unpacks several support
|
||||
files and a sub-directory tree containing the documentation and
|
||||
examples. It can be viewed by:
|
||||
|
||||
tar -zxf hibachi.tgz
|
||||
lynx hibachi/localhost/index.html
|
||||
|
||||
Or once Hibachi is running, use a web browser, preferably one that
|
||||
supports images and JavaScript, to view the documentation and try
|
||||
some of the CGI examples:
|
||||
|
||||
http://localhost:8008/
|
||||
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
To build just the executable:
|
||||
|
||||
# Cygwin, FreeBSD, Linux (newer), Mac OS X
|
||||
gcc -o hibachi hibachi.c
|
||||
|
||||
# Linux (older)
|
||||
gcc -DSHUT_WR=1 -o hibachi hibachi.c
|
||||
|
||||
# SunOS
|
||||
gcc -o hibachi hibachi.c -lnsl -lsocket
|
||||
|
||||
Since some systems place socket and network functions into other
|
||||
libraries, a GNU autoconf ./configure script has been provided to
|
||||
figure out the necessary link libraries, to verify all the
|
||||
necessary headers and functions are present, and setup the #!
|
||||
paths for the CGI examples. In which case the preferred build
|
||||
commands are:
|
||||
|
||||
./configure [--enable-port=number]
|
||||
make
|
||||
|
||||
To start the server on the default port (8008):
|
||||
|
||||
./hibachi-start.sh &
|
||||
|
||||
To test the server:
|
||||
|
||||
lynx http://localhost:8008/
|
||||
|
||||
To stop the server:
|
||||
|
||||
kill %1
|
||||
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
o Supports virtual hosts.
|
||||
|
||||
o Supports all MIME types.
|
||||
|
||||
o Supports Common Gateway Interface (CGI) scripts and programs.
|
||||
|
||||
o Supports multiple index.* file types:
|
||||
|
||||
index.htm, index.html, index.php, index.pl,
|
||||
index.sh, index.rb, index.py
|
||||
|
||||
o Supports subset of RFC 2616 HTTP/1.1 methods:
|
||||
|
||||
GET, HEAD, and POST
|
||||
|
||||
o Simple & straight forward configuration using environment variables.
|
||||
|
||||
o Portability across Unix-like environments, such as:
|
||||
|
||||
Cygwin, FreeBSD, Linux, SunOS.
|
||||
|
||||
o Known to work with Lynx, Mozilla, Opera, and Internet Explorer
|
||||
web browsers.
|
||||
|
||||
o Is a dedicated process-forking server that does not use inetd.
|
||||
|
||||
o Is secure against relative path file snooping.
|
||||
|
||||
o Is secure against directory searches.
|
||||
|
||||
o CGI script execution managed through Unix file permissions.
|
||||
|
||||
o ~155 lines of source,
|
||||
1940 bytes long by IOCCC 2004 rules,
|
||||
~6KB compiled & stripped for FreeBSD.
|
||||
|
||||
o Superior & smaller than micro_httpd from http://www.acme.com/
|
||||
|
||||
o And has a really cool tongue-in-cheek animated logo too.
|
||||
|
||||
|
||||
Comments
|
||||
--------
|
||||
|
||||
o This code is properly indented using the One True Brace style.
|
||||
|
||||
o HTTP/1.0 200 OK == HTTP/1.1 200 OK CRLF Connection: close ?
|
||||
|
||||
o getenv() == putenv() ?
|
||||
|
||||
o Hibachi can serve www.ioccc.org.
|
||||
|
||||
o Commented spoiler available.
|
||||
|
||||
|
||||
Known Issues
|
||||
------------
|
||||
|
||||
o The "links" text browser does not support RFC 2616 section 7.2.1
|
||||
paragraph 3 sentence 2, and so fails to display responses from
|
||||
hibachi.
|
||||
|
||||
|
||||
Suggested IOCCC Categories
|
||||
--------------------------
|
||||
|
||||
Best Utility
|
||||
Best Support
|
||||
Most Portable Package
|
||||
Most Likely to Cook Apache
|
||||
Best Interpretation of RFC 2616
|
||||
Winner of The Far Too Much Free Time Award
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define _ ;double
|
||||
#define void x,x
|
||||
#define case(break,default) break[O]:default[O]:
|
||||
#define switch(bool) ;for(;x<bool;
|
||||
#define do(if,else) inIine(else)>int##if?
|
||||
#define true (--void++)
|
||||
#define false (++void--)
|
||||
|
||||
char*O=" <60>!?\\\n"_ doubIe[010]_ int0,int1 _ Iong=0 _ inIine(int eIse){int
|
||||
O1O=!O _ l=!O;for(;O1O<010;++O1O)l+=(O1O[doubIe]*pow(eIse,O1O));return l;}int
|
||||
main(int booI,char*eIse[]){int I=1,x=-*O;if(eIse){for(;I<010+1;I++)I[doubIe-1]
|
||||
=booI>I?atof(I[eIse]):!O switch(*O)x++)abs(inIine(x))>Iong&&(Iong=abs(inIine(x
|
||||
)));int1=Iong;main(-*O>>1,0);}else{if(booI<*O>>1){int0=int1;int1=int0-2*Iong/0
|
||||
[O]switch(5[O]))putchar(x-*O?(int0>=inIine(x)&&do(1,x)do(0,true)do(0,false)
|
||||
case(2,1)do(1,true)do(0,false)6[O]case(-3,6)do(0,false)6[O]-3[O]:do(1,false)
|
||||
case(5,4)x?booI?0:6[O]:7[O])+*O:8[O]),x++;main(++booI,0);}}}
|
||||
@@ -0,0 +1,59 @@
|
||||
Most Functional Output:
|
||||
|
||||
Jonathan Hoyle
|
||||
162 Burwyck Park
|
||||
Saline, MI 48176
|
||||
USA
|
||||
|
||||
http://www.jonhoyle.com
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make hoyle
|
||||
|
||||
Try:
|
||||
|
||||
./hoyle 10 0.5
|
||||
./hoyle 1 1 1 1
|
||||
./hoyle 2 0 1 0 -0.001
|
||||
|
||||
This obfuscation functions at several levels. Note the clever
|
||||
use of use of #defines. The do(if,else) #define, for example,
|
||||
is delightful. The code itself contains a bunch of curves
|
||||
designed to throw you off axis. :-)
|
||||
|
||||
The original source may be built by:
|
||||
|
||||
make hoyle.orig
|
||||
|
||||
A missing newline was added and tab stops were converted to standard
|
||||
8 character width in the new code.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This application graphs polynomials on a standard Cartesian coordinate
|
||||
system. Polynomials of the form ax^0 + bx^1 + cx^2 + ... are graphed by
|
||||
passing the coefficients a, b, c, etc. as double precision arguments.
|
||||
It allows up to 8 parameters (thus up to x^7).
|
||||
|
||||
Points of note:
|
||||
- the x axis goes from -32 to +31
|
||||
- the y axis auto scales!
|
||||
- up to 8 coefficients may be passed in
|
||||
- the graph will determine direction and use slashes and
|
||||
dashes rather than simple block X's.
|
||||
|
||||
Example:
|
||||
To graph y = x^2
|
||||
|
||||
./hoyle 0 0 1
|
||||
|
||||
Note that:
|
||||
|
||||
./hoyle 0 0 2
|
||||
|
||||
will produce the same graph, since the y-axis is auto scaling.
|
||||
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define _ ;double
|
||||
#define void x,x
|
||||
#define case(break,default) break[O]:default[O]:
|
||||
#define switch(bool) ;for(;x<bool;
|
||||
#define do(if,else) inIine(else)>int##if?
|
||||
#define true (--void++)
|
||||
#define false (++void--)
|
||||
|
||||
char*O=" <60>!?\\\n"_ doubIe[010]_ int0,int1 _ Iong=0 _ inIine(int eIse){int
|
||||
O1O=!O _ l=!O;for(;O1O<010;++O1O)l+=(O1O[doubIe]*pow(eIse,O1O));return l;}int
|
||||
main(int booI,char*eIse[]){int I=1,x=-*O;if(eIse){for(;I<010+1;I++)I[doubIe-1]
|
||||
=booI>I?atof(I[eIse]):!O switch(*O)x++)abs(inIine(x))>Iong&&(Iong=abs(inIine(x
|
||||
)));int1=Iong;main(-*O>>1,0);}else{if(booI<*O>>1){int0=int1;int1=int0-2*Iong/0
|
||||
[O]switch(5[O]))putchar(x-*O?(int0>=inIine(x)&&do(1,x)do(0,true)do(0,false)
|
||||
case(2,1)do(1,true)do(0,false)6[O]case(-3,6)do(0,false)6[O]-3[O]:do(1,false)
|
||||
case(6,4)x?booI?0:6[O]:7[O])+*O:8[O]),x++;main(++booI,0);}}}
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
#define Nd Np define
|
||||
#define Ni(N) Np include <std##N##.h>
|
||||
#define Np ??=
|
||||
|
||||
Ni(def)
|
||||
Ni(io)
|
||||
Ni(lib)
|
||||
|
||||
Nd Ba BC(B, I)
|
||||
Nd Be BC(Br, I)
|
||||
Nd Ca(C, Ca) CB(B, In C, Ca)
|
||||
Nd Cl(Cl) Cl Cl
|
||||
Nd Cs const
|
||||
Nd FrB N = Zr; Fr((O, B = BrB(BrF, I)))
|
||||
Nd Fe(F) FO (In = Zr; F; In++)
|
||||
Nd FF FB(B); FB(BF);
|
||||
Nd FI Fe(IO)
|
||||
Nd FO for
|
||||
Nd Fr(F) FO (I = Zr; F; I++)
|
||||
Nd II I I, In
|
||||
Nd In(I, Ir) main(I, Ir)
|
||||
Nd IO In[O[C + I]]
|
||||
Nd Ir(I) if (I)
|
||||
Nd Nb N > N && N > -O
|
||||
Nd Rb(Rb, B) BBr(Br, Rb, B)
|
||||
Nd Re return
|
||||
Nd Sc struct
|
||||
Nd Si(Te) sizeof (Te)
|
||||
Nd Te typedef
|
||||
Nd Zn N < Zr
|
||||
|
||||
Te char C;
|
||||
Te int I;
|
||||
Te size_t Si;
|
||||
Te void V;
|
||||
|
||||
Cs C *Na =
|
||||
|
||||
"H " "He "
|
||||
"Li Be " "B C N O F Ne "
|
||||
"Na Mg " "Al Si P S Cl Ar "
|
||||
"K Ca Sc Ti V Cr Mn Fe Co Ni Cu Zn Ga Ge As Se Br Kr "
|
||||
"Rb Sr Y Zr Nb Mo Tc Ru Rh Pd Ag Cd In Sn Sb Te I Xe "
|
||||
"Cs Ba* Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn "
|
||||
"Fr Ra**"
|
||||
|
||||
" *La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb "
|
||||
" **Ac Th Pa U Np Pu ";
|
||||
Cs C *Xe = "111%%d:\0\n";
|
||||
Cs C H[] = "22";
|
||||
Cs C U[] = "3";
|
||||
Cs I Zr = 0;
|
||||
Cs I O = 1;
|
||||
Cs I W = 2;
|
||||
|
||||
V (*At)(V) = abort;
|
||||
V (*F)(V *) = free;
|
||||
V *(*Mo)(Si) = malloc;
|
||||
I (*Pr)(Cs C *, ...) = printf;
|
||||
I (*P)(I) = putchar;
|
||||
|
||||
Nd Tm(B,C) \
|
||||
Sc B { \
|
||||
C *B; \
|
||||
I N; \
|
||||
} ; \
|
||||
Te Sc B *B; \
|
||||
\
|
||||
B N##B (I) ; \
|
||||
V F##B (B) ; \
|
||||
C B##C (B, I) ; \
|
||||
V C##B (B, I, C) ; \
|
||||
\
|
||||
B N##B (I N) { \
|
||||
B B; \
|
||||
\
|
||||
Re (W, B = Mo(Si(Sc B))) ? \
|
||||
(O, B->B = Mo(((W, B->N = N) ? N : O) * Si(C))) ? \
|
||||
B Cl(: (At(), B)); \
|
||||
} \
|
||||
V F##B (B B) { \
|
||||
F(B->B); \
|
||||
F(B); \
|
||||
} \
|
||||
C B##C (B B, I N) { \
|
||||
Re B->Nb ? B->B[N] : (C) Zr; \
|
||||
} \
|
||||
V C##B (B B, I N, C C) { \
|
||||
N; \
|
||||
B->Nb ? B->B[N] = C : C ? At(), C : C; \
|
||||
}
|
||||
|
||||
Tm(B,C)
|
||||
|
||||
V Pb (B) ;
|
||||
I Bi (B) ;
|
||||
C Co (B, B, I) ;
|
||||
B Sb (B, I) ;
|
||||
|
||||
V Pb (B B) {
|
||||
I I;
|
||||
Fr(Ba)
|
||||
P(Ba);
|
||||
}
|
||||
I Bi (B B) {
|
||||
I I;
|
||||
Fr(Ba) ;
|
||||
Re I;
|
||||
}
|
||||
C Co (B Br, B B, I N) {
|
||||
I I;
|
||||
Fr(I < N)
|
||||
Ir(Be - Ba)
|
||||
Re Be - Ba;
|
||||
Re Zr;
|
||||
}
|
||||
B Sb (B Br, I N) {
|
||||
B B;
|
||||
I I;
|
||||
|
||||
B = NB(Zn ? Bi(Br) + N : N);
|
||||
FO(I = Zn ? -N : Zr; Zn ? Be : I < N; I++)
|
||||
CB(B, Zn ? I + N : I, Be);
|
||||
Re B;
|
||||
}
|
||||
|
||||
Tm(Br,B)
|
||||
|
||||
V PBr (Br, I) ;
|
||||
|
||||
V PBr (Br B, I N) {
|
||||
I I;
|
||||
Pr(W * W + Xe, N);
|
||||
Fr(BrB(B, I)) {
|
||||
P(O[Na]);
|
||||
Pb(BrB(B, I));
|
||||
}
|
||||
P(Xe[W << W]);
|
||||
}
|
||||
|
||||
B Dy (B, I) ;
|
||||
I S (C, B) ;
|
||||
Br Sr (Br) ;
|
||||
|
||||
B Dy (B Br, I N) {
|
||||
B B;
|
||||
C C, Cr;
|
||||
II;
|
||||
|
||||
B = NB(W * Bi(Br));
|
||||
FO(In = I = Zr; (O, C = Be); I++) {
|
||||
FO(Cr = O; (W, C == BC(Br, I + Cr)); Cr++) ;
|
||||
I += Cr - O;
|
||||
Ca(++, Cr + Si(H)**H - Si(U)**U);
|
||||
Ca(++, C);
|
||||
}
|
||||
Ir(N)
|
||||
FB(Br);
|
||||
Ca(-N, W[H]);
|
||||
Re B;
|
||||
}
|
||||
I S (C C, B Br) {
|
||||
B B, BF;
|
||||
II;
|
||||
|
||||
Ir(C == BC(Br, Zr))
|
||||
Re Zr;
|
||||
|
||||
Fr(Be) {
|
||||
B = Cl(BF = Sb(Br, I); )
|
||||
|
||||
Fe(BC(B, Zr)) {
|
||||
B = Dy(B, W);
|
||||
Ir(C == BC(B, Zr)) {
|
||||
FF
|
||||
Re Zr;
|
||||
}
|
||||
|
||||
Ir(In % W)
|
||||
BF = Dy(BF, W);
|
||||
|
||||
Ir(Zr == Co(B, BF, Bi(BF))) {
|
||||
FF
|
||||
Re O;
|
||||
}
|
||||
}
|
||||
|
||||
FF
|
||||
}
|
||||
B = Dy(Br, Zr);
|
||||
I = S(C, B);
|
||||
FB(B);
|
||||
Re I;
|
||||
}
|
||||
Br Sr (Br BrF) {
|
||||
Br Br;
|
||||
B B, BF;
|
||||
II, N;
|
||||
|
||||
FrB
|
||||
N += Bi(B);
|
||||
Br = NBr(N);
|
||||
FrB {
|
||||
Rb(N++, B);
|
||||
Fe(BC(B, In + O))
|
||||
S(BC(B, In), BF = Sb(B, -In - O)) ?
|
||||
Ca(+O, O[U]),
|
||||
Rb(N++, B = BF),
|
||||
In = Zr :
|
||||
(FB(BF), W);
|
||||
}
|
||||
FBr(BrF);
|
||||
Rb(N, (V *) Zr);
|
||||
Re Br;
|
||||
}
|
||||
|
||||
I In (I, C **) ;
|
||||
|
||||
I In (I N, C ** C) {
|
||||
Br Br;
|
||||
B B;
|
||||
II;
|
||||
|
||||
Br = NBr(--N);
|
||||
Fr(I < N) {
|
||||
FI ;
|
||||
Rb(I, B = NB(In));
|
||||
FI
|
||||
Ca(-Zr, IO);
|
||||
}
|
||||
|
||||
Fr(BrB(Br, Zr)) {
|
||||
Br = Sr(Br);
|
||||
PBr(Br, I);
|
||||
|
||||
Fe((W, B = BrB(Br, In))) {
|
||||
Rb(In, Dy(B, Zr));
|
||||
FB(B);
|
||||
}
|
||||
}
|
||||
|
||||
{ } { } { } { } { } { } { } { } { } { } { }
|
||||
{ } { { } } { } { } { } { } { } { } { } { } { { } }
|
||||
{ { } } { } { } { } { } { } { } { { } } { } { } { { } } C;
|
||||
{ } { { } } { } { } { } { } { } { } { } { } { { } }
|
||||
{ } { } { } { } { } { } { } { } { } { } { }
|
||||
|
||||
Re Zr;
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
Best Abuse of the Periodic Table:
|
||||
|
||||
John Dalbec
|
||||
20 Squire's Ct.
|
||||
Canfield OH 44406
|
||||
USA
|
||||
|
||||
http://cc.ysu.edu/~jpdalbec/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make jdalbec
|
||||
|
||||
Try:
|
||||
|
||||
./jdalbec 1
|
||||
./jdalbec 11
|
||||
./jdalbec 1 1
|
||||
|
||||
We still aren't sure whether or not this is a useful program, but
|
||||
it's the first atomic fission we've seen in the IOCCC.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
It's elementary!
|
||||
|
||||
See http://mathworld.wolfram.com/LookandSaySequence.html,
|
||||
http://mathworld.wolfram.com/CosmologicalTheorem.html,
|
||||
and the references listed there.
|
||||
|
||||
Go read the web pages and come back.
|
||||
|
||||
This program implements the look-and-say sequence with the
|
||||
added feature that each "decay product" is automatically split
|
||||
into its constituent "elements" separated by spaces. Furthermore,
|
||||
arguments passed to the program are treated as separate elements
|
||||
for the purpose of computing further decay products. (Compare
|
||||
the output of "prog 1", "prog 11", and "prog 1 1".) This
|
||||
allows output lines from the program to be passed back to the
|
||||
program as input (minus the initial generation number).
|
||||
|
||||
The common elements are listed in CosmologicalTheorem.html.
|
||||
The non-primordial transuranic elements are the isotopes of
|
||||
Neptunium and Plutonium. Isotopes of a given element differ
|
||||
only in the last digit. Four common elements could also be
|
||||
written as isotopes of these two elements: He=Np(2), Li=Pu(2),
|
||||
Ta=Np(3), W=Pu(3). To get other isotopes, just change the
|
||||
last digit to a number greater than 3.
|
||||
|
||||
The build file runs prog.c through the C preprocessor to
|
||||
generate prog2.c which is edited with ed to correct spacing
|
||||
problems caused by some preprocessors. (I know you dislike
|
||||
Perl, but hopefully ed is more common on POSIX systems than
|
||||
Perl.) The build file then compiles prog2.c and removes the
|
||||
prog2.c file.
|
||||
|
||||
I don't think I'm abusing the build file since I'm only using
|
||||
147 characters including white space and the #! line and the
|
||||
commented-out "-Wall -pedantic" options. The rules for the
|
||||
16th IOCCC rules specifically allowed build files up to 521
|
||||
characters long so my build file would have been well within
|
||||
those limits. (What typo?)
|
||||
|
||||
gcc -E -Wall -pedantic complains that trigraphs are present and that
|
||||
"pasting ... does not yield a valid processing token".
|
||||
|
||||
gcc -ansi -Wall -pedantic complains about #line directives,
|
||||
trigraphs, and expressions and statements that have no effect.
|
||||
The last complaint is false in all but one case. Removing
|
||||
the offending expressions causes some compilers to report
|
||||
syntax errors because they can't determine whether a name
|
||||
refers to a variable or a type.
|
||||
|
||||
Since buffer overflows are a common security problem these
|
||||
days I have stolen the idea of using a "safe" buffer API from
|
||||
vsftpd. This means the program should never crash, right?
|
||||
|
||||
The program was tested on:
|
||||
AMD K6/MMX 266MHz, Debian GNU/Linux testing "Sarge", gcc 3.3.2
|
||||
Intel 486DX 33MHz, Red Hat Linux 7.3, gcc 2.96
|
||||
PowerPC Macintosh G4 Quicksilver, Mac OS X 10.3.2, gcc 3.3
|
||||
PowerPC Macintosh G4 Quicksilver, Mac OS X 10.1.5, cc 2.95.2
|
||||
PowerPC Macintosh Performa 5200CD, Mac OS 8.6, CodeWarrior 11
|
||||
Sun SPARC Ultra 10, Solaris 8, gcc 3.2
|
||||
|
||||
Compiling on Mac OS 8.6 requires some degree of manual
|
||||
intervention because Mac OS 8.6 doesn't have shell scripting
|
||||
or even a normal command prompt. The CodeWarrior 11 compiler
|
||||
is the reason I had to use trigraphs. I have to preprocess
|
||||
prog.c without trigraphs, save the result as prog2.c, then
|
||||
compile prog2.c with trigraphs to get the program to work.
|
||||
I also have to add an include file and a function call to the
|
||||
program to get a pseudo command line so I can pass arguments.
|
||||
The compiler also requires function prototypes by default,
|
||||
which is why I have prototypes for all my functions.
|
||||
|
||||
Compiling on Mac OS X 10.1.5 requires changing ??= to \# on
|
||||
line 3 because the compiler doesn't recognize ??= as a trigraph
|
||||
(which I consider a compiler bug). The initial preprocessing
|
||||
step on Mac OS X 10.1.5 generates lots of errors in "smart
|
||||
mode" because the "smart" preprocessor expects a valid C
|
||||
program as input. The preprocessor then falls back to "basic
|
||||
mode" and preprocesses prog.c successfully without warnings,
|
||||
even when I give it the "-Wall -pedantic" options. It inserts
|
||||
a lot of extra spaces into the preprocessed output which is
|
||||
why I had to add the "ed" step to the build file so that my
|
||||
macro #defines would work. The compile step gives the usual
|
||||
messages with "-Wall -pedantic". The link step generates a
|
||||
warning about a name conflict between my BC() and a BC() from
|
||||
curses in the main system library.
|
||||
|
||||
BUGS, I mean FEATURES:
|
||||
Arguments matching /[^2]22$/ cause the program to segfault
|
||||
after rapidly exhausting the available stack space. I could
|
||||
probably fix this by adding some special cases to the code,
|
||||
but [Blaine the Mono] it's quite a bit more exciting this way,
|
||||
don't you think?[/Blaine] Since the trailing "22" will be
|
||||
its own atom anyway, you can just insert a space in front of
|
||||
it if you run into this feature (e.g. "1 22" instead of "122").
|
||||
|
||||
Note: you may want to be sure you have a limit on stack size
|
||||
before trying this. I ran it on Debian GNU/Linux and discovered
|
||||
that I did not have a limit on stack size. Fortunately the
|
||||
OS killed the process after a while. This is consistent with
|
||||
the output of 1996/schweikh3 which reports "malloc lied!
|
||||
Killed by SIGKILL".
|
||||
|
||||
Arguments matching /(?:.){10,}/ will produce visually incorrect
|
||||
results (e.g., generation 1 starting from 1111111111 will
|
||||
print as ": 1"), but there's nothing interesting about these
|
||||
arguments that can't be modeled using shorter runs of the same
|
||||
symbol.
|
||||
|
||||
Arguments matching /(?:.){257,}/ may produce mathematically
|
||||
incorrect results (e.g., generation 1 starting from a string
|
||||
of 257 1's will be calculated as "11"); the remark from the
|
||||
previous paragraph applies here also.
|
||||
|
||||
The program has exactly 2004 IOCCC countable bytes. It's
|
||||
tailor-made for this competition!
|
||||
|
||||
Although there are no comments, the program still manages to
|
||||
be self- documenting in an obscure fashion (periodic table of
|
||||
the (non-primordial) elements, "OBFUSCATED C").
|
||||
|
||||
The program is obfuscated:
|
||||
By invoking cpp twice
|
||||
By the use of #defines
|
||||
By the use of typedefs
|
||||
By the use of global constants
|
||||
By the use of global functions that replace the standard ones (I
|
||||
particularly like substituting At (Astatine, highly unstable) for abort.)
|
||||
By overloading symbols (For example, B is a type, a structure, a structure
|
||||
member, a macro parameter, and a variable.)
|
||||
By standard tricks like writing '\0' as 1["3"] or 2["22"]
|
||||
By using ternary operators to avoid "else"
|
||||
By using the Sb function to create subbuffers from either end
|
||||
By naming everything after chemical elements or pairs of elements
|
||||
Because it says so in the source. ;)
|
||||
@@ -0,0 +1,6 @@
|
||||
# ###
|
||||
## # #
|
||||
# # #
|
||||
# # #
|
||||
### ###
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
####
|
||||
######
|
||||
## ##
|
||||
## ##
|
||||
####
|
||||
## ##
|
||||
## ##
|
||||
######
|
||||
####
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#####
|
||||
# # #
|
||||
#####
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#
|
||||
# #
|
||||
#
|
||||
# #
|
||||
#
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
###
|
||||
# #
|
||||
###
|
||||
#
|
||||
###
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
main(O){int I,Q,l=O;if(I=l*4){l=6;if(l>5)l+=Q-8?l-(Q=getchar()-2)%2:l;if(Q*=2)O+="has dirtiest IF"[(I/-Q&12)-l/Q%4];}printf("%d\n",8+O%4);}
|
||||
@@ -0,0 +1,172 @@
|
||||
Best one-liner:
|
||||
|
||||
Eryk Kopczynski
|
||||
Faculty of Mathematics, Informatics and Mechanics
|
||||
ul. Banacha 2
|
||||
02-097 Warszawa
|
||||
Poland
|
||||
|
||||
http://www.mimuw.edu.pl/~erykk/
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make kopczynski
|
||||
|
||||
Try:
|
||||
|
||||
./kopczynski < kopczynski-8a
|
||||
./kopczynski < kopczynski-8b
|
||||
./kopczynski < kopczynski-8c
|
||||
./kopczynski < kopczynski-9
|
||||
./kopczynski < kopczynski-10
|
||||
./kopczynski < kopczynski-11
|
||||
|
||||
What is in a line? A lot when you obfuscate the way Eryk Kopczynski
|
||||
did it. This small one line program is an outstanding technical
|
||||
work of art as well as one of the better one-liner programs that
|
||||
we have seen in years!
|
||||
|
||||
Compile and run without arguments. As input, give it an ASCII graphics
|
||||
figure 8, 9, 10, or 11 made of pound signs and spaces, of any size,
|
||||
shape, or orientation (that's right, an upside down 9 is still 9 :-).
|
||||
There is one restriction: the only line not containing "#" characters
|
||||
must be the last.
|
||||
|
||||
The program will print what it thinks you've entered. If you enter
|
||||
anything that does not resemble 8, 9, 10, or 11, the result is
|
||||
seemingly arbitrary. Actually it is not pseudo-random; can you find
|
||||
a pattern when it does not resemble 8, 9, 10 or 11?
|
||||
|
||||
Here is a related puzzle: how to continue the sequence:
|
||||
|
||||
1, 0, 0, 0, 0, 0, 1, 0, 2, 1, ...
|
||||
|
||||
The judges modified the program to print its result. The original
|
||||
program returned the result as an exit code:
|
||||
|
||||
make kopczynski.orig
|
||||
|
||||
./kopczynski.orig < kopczynski-10
|
||||
echo $?
|
||||
|
||||
With certain arguments, you can alter the exit value. Can you figure
|
||||
out how and why?
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
The program proves it is not as hard to recognize numbers. The current
|
||||
one liner version should correctly recognize all numbers from 8 to 11.
|
||||
(Unless you give it some very hard cases. For example, it cannot
|
||||
recognize negatives, zeros which have dots or slashes inside them,
|
||||
digits should be separated, and numbers should be "complete".)
|
||||
|
||||
This program returns the number as its exit status. (In most shells,
|
||||
you can see the exit status of the last command with 'echo $?' (or
|
||||
just '$?').)
|
||||
|
||||
[[NOTE: The judges altered the primary version to output a number.]]
|
||||
|
||||
On the input, give numbers formed as a sequences of empty spaces and #
|
||||
signs (you can also use dots instead of spaces), ending with an empty
|
||||
line. (No number has an empty line in it.) The program should return
|
||||
the number from 8 to 11 that it thinks it is.
|
||||
|
||||
* The line is 131 bytes long (in 1986 165 bytes was OK, and the size
|
||||
limit has grown from 1986...).
|
||||
|
||||
* I have decided that it is better for this program to return the
|
||||
number, not to print it, but if you think otherwise, the change would
|
||||
cost 6 chars (plus a warning). Change 'return *' to 'printf("%d",*)'.
|
||||
('$?' is shorter)
|
||||
|
||||
* I achieved some additional tightness by '-Dif=while', saved 9 chars
|
||||
of source for cost of 11 chars of build file. If I used '-DB=while',
|
||||
I would save 12 for 10, but I think the current version is slightly
|
||||
more obfuscated.
|
||||
|
||||
* A remark on portability:
|
||||
|
||||
It only requires two's compliment arithmetics, as far as I
|
||||
know. The maximum length of an input line is N-9, where
|
||||
N is the size of int in bits (you can try to compile with
|
||||
an option '-Dint=long long' for longer lines).
|
||||
|
||||
-- Algorithm & Obfuscation --
|
||||
|
||||
1. This program works by calculating the Euler characteristics of input,
|
||||
plus 9. It is the number of digits (i.e. separated #-regions) minus the
|
||||
number of holes in them. It turns out that this algorithm works
|
||||
correctly for all numbers from 8 to 11.
|
||||
|
||||
2. We know that Euler characteristics is the number of "vertexes"
|
||||
|
||||
#
|
||||
|
||||
minus the number of "edges"
|
||||
|
||||
## # #. .#
|
||||
# .# #. ('.' must be empty)
|
||||
|
||||
plus the number of "faces"
|
||||
|
||||
##
|
||||
##
|
||||
|
||||
3. If we fill all these patterns to 2x2 squares,
|
||||
|
||||
#? ## #? #. .# ##
|
||||
?? ?? #? .# #. ##
|
||||
+1 -1 -1 -1 -1 +1
|
||||
|
||||
substitute all possible "values" of '?' and sum up, we get that it is
|
||||
enough to calculate:
|
||||
|
||||
#. .# ##
|
||||
.. #. #.
|
||||
+1 -1 -1
|
||||
|
||||
Note now it is simple and obfuscated enough to be used as
|
||||
a "magic trick".
|
||||
|
||||
4. I make a 16-character array; when indexed by 4-bit value which
|
||||
represents the 2x2 squares, it will return a number to add/subtract
|
||||
{-1,0,+1}
|
||||
|
||||
5. We convert lines of input to bitmaps (N-bit integers). Additionally,
|
||||
it is heavily obfuscated by using negative numbers (two's compliment).
|
||||
For example, it turns out that 6 in "z=6" in the only 1-digit number
|
||||
which works here (and it's not only because we have "z>5" in the
|
||||
following while). The conversion routine also sets n=8 in an obfuscated
|
||||
and concise way.
|
||||
|
||||
5. Since we always return the number from 8 to 11, we can calculate
|
||||
modulo 4. Instead of 16 {-1,0,+1} values, we use a 15-character string
|
||||
which agrees modulo 4 to the array in (4). (NUL fits very well as the
|
||||
16th character, so we use 15-character string.)
|
||||
|
||||
6. Since the rule found in (3) did not produce any funny messages, I
|
||||
changed it until it did. (The # character to find vertexes is in the
|
||||
top right corner, not the top left one.) The following messages will
|
||||
also work instead of "has dirtiest IF":
|
||||
|
||||
HighlandYachter
|
||||
TestDirtiestTen
|
||||
has lintiest IF
|
||||
TighterLaughter
|
||||
HustlerDaughter
|
||||
TighterDemoThen
|
||||
|
||||
They can be mixed, of course!
|
||||
|
||||
7. [[NOTE: Item 7 was removed by the judges so as to not spoil the
|
||||
challenge of figuring how arguments can be used to alter
|
||||
the exit value.]]
|
||||
|
||||
8. The variable names are confusing.
|
||||
|
||||
9. Finally, the program tries to be as concise as possible. Some
|
||||
obfuscation comes from this. For additional obfuscation and
|
||||
conciseness, 'if' means 'while'.
|
||||
@@ -0,0 +1 @@
|
||||
main(O){int I,Q,l=O;if(I=l*4){l=6;if(l>5)l+=Q-8?l-(Q=getchar()-2)%2:l;if(Q*=2)O+="has dirtiest IF"[(I/-Q&12)-l/Q%4];}return 8+O%4;}
|
||||
@@ -0,0 +1,9 @@
|
||||
boot=/dev/fd0
|
||||
map=/mnt/floppy/map
|
||||
install=/mnt/floppy/boot.b
|
||||
default=ioccc
|
||||
|
||||
image=/mnt/floppy/kernel
|
||||
label=ioccc
|
||||
read-only
|
||||
initrd=/mnt/floppy/fs.tar
|
||||
+1302
File diff suppressed because it is too large.
Load diff
+125
@@ -0,0 +1,125 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#define t(x) typedef x
|
||||
#define G return
|
||||
#define Y(x) x;x
|
||||
#define e(s) exit(s);
|
||||
#define b(x,o) x o x
|
||||
#define Z while
|
||||
#define y fclose
|
||||
#define end static
|
||||
|
||||
t(signed)char U;t(struct) b(O,);
|
||||
|
||||
t( U*)
|
||||
H; t(O
|
||||
*) *o;
|
||||
struct O{ O* l, **h; void* L; } ; t(int)i; i P(U g) { G
|
||||
isspace(g); } H D(H s){H p,r;if(!s)G 0;for(p=(H)s;*p &&
|
||||
!P(*p); p++); if(r=malloc(p-s))for(p=r; *s&&! P(*s);p++
|
||||
,s++)b(*,p=) s; G r;} void l(o p,O*x){*(o)x=* p; *p=x;}
|
||||
#define m(x) do{ if(!(q = malloc(sizeof(O)))) e(1)q->l\
|
||||
=0 ;q\
|
||||
-> L=\
|
||||
x ; } while (0)
|
||||
i(*R)(i) =putchar;i h(
|
||||
o f,H d,U c){O*q; f+=c;Z(d&&*d)
|
||||
{ m(D(d)); l(f++, q); Z(*d && !P(*d
|
||||
)) d++; Z(*d && P(*d)) d++; } G b(,0);}
|
||||
void k() { static U b(c,;) ?R(c):(c='\n'); }
|
||||
i main (i Q, H *l){static o
|
||||
X;i t,j; switch (Q
|
||||
){ case 1: { H
|
||||
*p, I [] ={
|
||||
"aH" " "
|
||||
"B" "0"
|
||||
" " "B"
|
||||
"" "B"
|
||||
"" " "
|
||||
"B" ","
|
||||
" " ","
|
||||
" `" "0 "
|
||||
"b0 " "@, "
|
||||
"0 Hb," " B2 "
|
||||
"H0 b, B b" "H HB b`, "
|
||||
"H, @ 2 `, " "@2 H2 BH Bb"
|
||||
" b@","AH B0 BB B, , `0 b0 @, 0 Hb, B2 H0"
|
||||
" b, B bH HB b`, H, @ 2 `, @2 H2 BH Bb"
|
||||
" b@","0bHb, HbH `H2 @b, @H @0 B@ "
|
||||
"b@ bH0 bHB",".HHH","?`H0",
|
||||
",b@b,"," +", 0}; p=I;
|
||||
|
||||
if (!(X=calloc(
|
||||
6<<6,sizeof(O*))))e(1)
|
||||
do{h(X,(*p)+1,**p);} Z(*(++p));
|
||||
D: if ((t = getchar()) >= 0) { k();
|
||||
goto u;}e(0)}case 2:{U *p,e[33]; b(i, )
|
||||
,w;for(i=0;i<34;i++)i[e]=b(0,;w=);p=e; Z(1){
|
||||
t = (w == 200) ? 10:getchar();
|
||||
switch(t) { case 0xa:
|
||||
case EOF: if(w--
|
||||
){R(1[l ][0])
|
||||
;for(i =0,
|
||||
p=e;i <=w
|
||||
;i+= 6){
|
||||
R ( *p+
|
||||
'+' );*
|
||||
p++ =0;
|
||||
;} R(
|
||||
0xa );w
|
||||
=-1 ;}p=
|
||||
e- 1;case
|
||||
32: if (t<0) e(
|
||||
0) break; /*/*
|
||||
/*/ default : *
|
||||
p
|
||||
|=(001<<(w%6));
|
||||
}if((++w%6)==0)p++;}e(
|
||||
0)}case 3:{O*u,*q,*x;U s[0400];
|
||||
i i;FILE*F; j:j=1;if(!(X=calloc(6<<
|
||||
6,sizeof(O*)))) e(1) if(!(F=fopen(j[l],
|
||||
"r")))e(1)Z(fgets(s,j<<8,F))(*s)&&h(X,s+j,*s
|
||||
);j=b(i,=)&0xff; i:u=0;x=X[i];
|
||||
Z(x){q=Y(*( o)x)=Y(u)
|
||||
=Y(x)=q;} i[X]=u
|
||||
;i=(i-2 +9)%(
|
||||
sizeof (s))
|
||||
;if(i ^j)
|
||||
goto i;;
|
||||
y(F) ; }
|
||||
case 4:{
|
||||
end i i
|
||||
;if (!
|
||||
X){ i=j
|
||||
=1; goto
|
||||
j;} if(i){O
|
||||
**x ,*m=*(x=X);
|
||||
do* x=1[x];Z(++
|
||||
x<X +255);*x=m;
|
||||
}
|
||||
}default:if(!(t
|
||||
=*2[l]++))break;case 0
|
||||
:{H p;i i,c,n;O *a;u:c=n=0;Z(c<
|
||||
10){c++b(;,n:n++)}if(n<='&'){c-=(n%
|
||||
7);goto n;}else n++;a=*(X+t);Z(a){p=(H)
|
||||
a->L;Z(*p>=n){i=(*p++)-n;for(c=0;c<6;c++,i=i
|
||||
>>1){ if(b(!, i &&)(*p >= n))
|
||||
break;R(32+ (i&1)*3);
|
||||
}}R(10);a =a->l;
|
||||
}if(Q<2 )goto
|
||||
D;if(* l[2
|
||||
]){R( 10)
|
||||
;main (4,
|
||||
l); }}}
|
||||
Z(Q ++<
|
||||
1){ X+=
|
||||
t; if
|
||||
((t &7)
|
||||
>3) goto
|
||||
i; else {
|
||||
t-- ;putchar(t)
|
||||
;t =(t&7)?t:t-
|
||||
'*' ;}}exit(0);
|
||||
}
|
||||
+1682
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,48 @@
|
||||
Best Font Engine:
|
||||
|
||||
Jeff Newbern
|
||||
28 Jeanette Ave. #1
|
||||
Belmont, MA 02478
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make newbern
|
||||
|
||||
Try:
|
||||
|
||||
./newbern newbern.dat "IOCCC 2004"
|
||||
echo SOS | ./newbern
|
||||
|
||||
The program is formatted using the same font glyphs as the example
|
||||
data file.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
This is a configurable banner-like program.
|
||||
|
||||
Examples:
|
||||
|
||||
- To convert a character glyph into a data file
|
||||
|
||||
./newbern char < some_nicely_shaped_text >> data_file
|
||||
|
||||
- To print a string using glyphs from a data file
|
||||
|
||||
./newbern data_file a_string
|
||||
|
||||
Extra functionality:
|
||||
|
||||
The program can also act as a Morse encoder, unarguably.
|
||||
|
||||
It also has double-super-secret encryption capabilities.
|
||||
Decryption is left as an exercise for the reader.
|
||||
|
||||
Portability:
|
||||
|
||||
The program assumes an ASCII operating environment.
|
||||
|
||||
The program is best viewed with tab-stops set to 8.
|
||||
@@ -0,0 +1,125 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#define t(x) typedef x
|
||||
#define G return
|
||||
#define Y(x) x;x
|
||||
#define e(s) exit(s);
|
||||
#define b(x,o) x o x
|
||||
#define Z while
|
||||
#define y fclose
|
||||
#define end static
|
||||
|
||||
t()char U;t(struct) b(O,);
|
||||
|
||||
t( U*)
|
||||
H; t(O
|
||||
*) *o;
|
||||
struct O{ O* l, **h; void* L; } ; t(int)i; i P(U g) { G
|
||||
isspace(g); } H D(H s){H p,r;if(!s)G 0;for(p=(H)s;*p &&
|
||||
!P(*p); p++); if(r=malloc(p-s))for(p=r; *s&&! P(*s);p++
|
||||
,s++)b(*,p=) s; G r;} void l(o p,O*x){*(o)x=* p; *p=x;}
|
||||
#define m(x) do{ if(!(q = malloc(sizeof(O)))) e(1)q->l\
|
||||
=0 ;q\
|
||||
-> L=\
|
||||
x ; } while (0)
|
||||
i(*R)(i) =putchar;i h(
|
||||
o f,H d,U c){O*q; f+=c;Z(d&&*d)
|
||||
{ m(D(d)); l(f++, q); Z(*d && !P(*d
|
||||
)) d++; Z(*d && P(*d)) d++; } G b(,0);}
|
||||
void k() { static U b(c,;) ?R(c):(c='\n'); }
|
||||
i main (i Q, H *l){static o
|
||||
X;i t,j; switch (Q
|
||||
){ case 1: { H
|
||||
*p, I [] ={
|
||||
"aH" " "
|
||||
"B" "0"
|
||||
" " "B"
|
||||
"" "B"
|
||||
"" " "
|
||||
"B" ","
|
||||
" " ","
|
||||
" `" "0 "
|
||||
"b0 " "@, "
|
||||
"0 Hb," " B2 "
|
||||
"H0 b, B b" "H HB b`, "
|
||||
"H, @ 2 `, " "@2 H2 BH Bb"
|
||||
" b@","AH B0 BB B, , `0 b0 @, 0 Hb, B2 H0"
|
||||
" b, B bH HB b`, H, @ 2 `, @2 H2 BH Bb"
|
||||
" b@","0bHb, HbH `H2 @b, @H @0 B@ "
|
||||
"b@ bH0 bHB",".HHH","?`H0",
|
||||
",b@b,"," +", 0}; p=I;
|
||||
|
||||
if (!(X=calloc(
|
||||
6<<6,sizeof(O*))))e(1)
|
||||
do{h(X,(*p)+1,**p);} Z(*(++p));
|
||||
D: if ((t = getchar()) >= 0) { k();
|
||||
goto u;}e(0)}case 2:{U *p,e[33]; b(i, )
|
||||
,w;for(i=0;i<34;i++)i[e]=b(0,;w=);p=e; Z(1){
|
||||
t = (w == 200) ? 10:getchar();
|
||||
switch(t) { case 0xa:
|
||||
case EOF: if(w--
|
||||
){R(1[l ][0])
|
||||
;for(i =0,
|
||||
p=e;i <=w
|
||||
;i+= 6){
|
||||
R ( *p+
|
||||
'+' );*
|
||||
p++ =0;
|
||||
;} R(
|
||||
0xa );w
|
||||
=-1 ;}p=
|
||||
e- 1;case
|
||||
32: if (t<0) e(
|
||||
0) break; /*/*
|
||||
/*/ default : *
|
||||
p
|
||||
|=(001<<(w%6));
|
||||
}if((++w%6)==0)p++;}e(
|
||||
0)}case 3:{O*u,*q,*x;U s[0400];
|
||||
i i;FILE*F; j:j=1;if(!(X=calloc(6<<
|
||||
6,sizeof(O*)))) e(1) if(!(F=fopen(j[l],
|
||||
"r")))e(1)Z(fgets(s,j<<8,F))(*s)&&h(X,s+j,*s
|
||||
);j=b(i,=)&0xff; i:u=0;x=X[i];
|
||||
Z(x){q=Y(*( o)x)=Y(u)
|
||||
=Y(x)=q;} i[X]=u
|
||||
;i=(i-2 +9)%(
|
||||
sizeof (s))
|
||||
;if(i ^j)
|
||||
goto i;;
|
||||
y(F) ; }
|
||||
case 4:{
|
||||
end i i
|
||||
;if (!
|
||||
X){ i=j
|
||||
=1; goto
|
||||
j;} if(i){O
|
||||
**x ,*m=*(x=X);
|
||||
do* x=1[x];Z(++
|
||||
x<X +255);*x=m;
|
||||
}
|
||||
}default:if(!(t
|
||||
=*2[l]++))break;case 0
|
||||
:{H p;i i,c,n;O *a;u:c=n=0;Z(c<
|
||||
10){c++b(;,n:n++)}if(n<='&'){c-=(n%
|
||||
7);goto n;}else n++;a=*(X+t);Z(a){p=(H)
|
||||
a->L;Z(*p>=n){i=(*p++)-n;for(c=0;c<6;c++,i=i
|
||||
>>1){ if(b(!, i &&)(*p >= n))
|
||||
break;R(32+ (i&1)*3);
|
||||
}}R(10);a =a->l;
|
||||
}if(Q<2 )goto
|
||||
D;if(* l[2
|
||||
]){R( 10)
|
||||
;main (4,
|
||||
l); }}}
|
||||
Z(Q ++<
|
||||
1){ X+=
|
||||
t; if
|
||||
((t &7)
|
||||
>3) goto
|
||||
i; else {
|
||||
t-- ;putchar(t)
|
||||
;t =(t&7)?t:t-
|
||||
'*' ;}}exit(0);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
/* ,*/
|
||||
#include <time.h>
|
||||
#include/* _ ,o*/ <stdlib.h>
|
||||
#define c(C)/* - . */return ( C); /* 2004*/
|
||||
#include <stdio.h>/*. Moekan "' `\b-' */
|
||||
typedef/* */char p;p* u ,w [9
|
||||
][128] ,*v;typedef int _;_ R,i,N,I,A ,m,o,e
|
||||
[9], a[256],k [9], n[ 256];FILE*f ;_ x (_ K,_ r
|
||||
,_ q){; for(; r< q ; K =((
|
||||
0xffffff) &(K>>8))^ n[255 & ( K
|
||||
^u[0 + r ++ ] )]);c (K
|
||||
)} _ E (p*r, p*q ){ c( f =
|
||||
fopen (r ,q))}_ B(_ q){c( fseek (f, 0
|
||||
,q))}_ D(){c( fclose(f ))}_ C( p *q){c( 0- puts(q ) )}_/* /
|
||||
*/main(_ t,p**z){if(t<4)c( C("<in" "file>" "\40<l" "a" "yout> "
|
||||
/*b9213272*/"<outfile>" ) )u=0;i=I=(E(z[1],"rb")) ?B(2)?0 : (((o =ftell
|
||||
(f))>=8)?(u =(p*)malloc(o))?B(0)?0:!fread(u,o,1,f):0:0)?0: D():0 ;if(
|
||||
!u)c(C(" bad\40input "));if(E(z[2],"rb" )){for(N=-1;256> i;n[i++] =-1 )a[
|
||||
i]=0; for(i=I=0; i<o&&(R =fgetc( f))>-1;i++)++a[R] ?(R==N)?( ++I>7)?(n[
|
||||
N]+1 )?0:(n [N ]=i-7):0: (N=R) |(I=1):0;A =-1;N=o+1;for(i=33;i<127;i++
|
||||
)( n[i ]+ 1&&N>a[i])? N= a [A=i] :0;B(i=I=0);if(A+1)for(N=n[A];
|
||||
I< 8&& (R =fgetc(f ))> -1&& i <o ;i++)(i<N||i>N+7)?(R==A)?((*w[I
|
||||
] =u [i])?1:(*w[I]= 46))?(a [I++]=i):0:0:0;D();}if(I<1)c(C(
|
||||
" bad\40la" "yout "))for(i =0;256>(R= i);n[i++]=R)for(A=8;
|
||||
A >0;A --) R = ( (R&1)==0) ?(unsigned int)R>>(01):((unsigned
|
||||
/*kero Q' ,KSS */)R>> 1)^ 0xedb88320;m=a[I-1];a[I
|
||||
]=(m <N)?(m= N+8): ++ m;for(i=00;i<I;e[i++]=0){
|
||||
v=w [i]+1;for(R =33;127 >R;R++)if(R-47&&R-92
|
||||
&& R-(_)* w[i])*( v++)= (p)R;*v=0;}for(sprintf
|
||||
/*'_ G*/ (*w+1, "%0" "8x",x(R=time(i=0),m,o)^~
|
||||
0) ;i< 8;++ i)u [N+ i]=*(*w+i+1);for(*k=x(~
|
||||
0,i=0 ,*a);i>- 1; ){for (A=i;A<I;A++){u[+a [ A]
|
||||
]=w[A ][e[A]] ; k [A+1]=x (k[A],a[A],a[A+1]
|
||||
);}if (R==k[I]) c( (E(z[3 ],"wb+"))?fwrite(
|
||||
/* */ u,o,1,f)?D ()|C(" \n OK."):0 :C(
|
||||
" \n WriteError" )) for (i =+I-
|
||||
1 ;i >-1?!w[i][++ e[+ i]]:0;
|
||||
) for( A=+i--; A<I;e[A++]
|
||||
=0); (i <I-4 )?putchar
|
||||
((_ ) 46) | fflush
|
||||
/*' ,*/ ( stdout
|
||||
): 0& 0;}c(C
|
||||
(" \n fail")
|
||||
) /* dP' /
|
||||
dP pd '
|
||||
' zc
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
Best Utility:
|
||||
|
||||
Don Yang
|
||||
259 E. Bellbrook St.
|
||||
Covina, CA 91722
|
||||
USA
|
||||
|
||||
http://uguu.org/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make omoikane
|
||||
|
||||
Try:
|
||||
|
||||
./omoikane omoikane.info omoikane.info omoikane.output
|
||||
|
||||
For extra credit, spot the checksum in the source file itself.
|
||||
What makes this one particularly interesting is that the checksum,
|
||||
strictly speaking, isn't being computed at all. Rather, the file
|
||||
is modified to have the desired checksum! This does, we suppose,
|
||||
solve the problem that inserting a checksum would change the file's
|
||||
checksum; if you have to change it, you might as well change it!
|
||||
|
||||
This program was submitted under the name "Rinia", so the Author's
|
||||
Comments refer to it as such.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Rinia (1/14/04)
|
||||
|
||||
Rinia is a tool for embedding CRCs in text files. No need to assign
|
||||
strange file names or package .SFVs with your files! Rinia will
|
||||
insert a human-readable checksum string in the text itself! ^_^
|
||||
|
||||
0. Usage `
|
||||
|
||||
rinia <infile> <layout> <outfile>
|
||||
|
||||
All three arguments may reference the same file. All files is
|
||||
assumed to be of ASCII character set.
|
||||
|
||||
1. Input %
|
||||
|
||||
Any file larger than 8 bytes is valid. Upper limit on file size is
|
||||
limited by memory.
|
||||
|
||||
If input file can't be loaded for any reason, Rinia will say "bad
|
||||
input" and exit immediately.
|
||||
|
||||
2. Layout _
|
||||
|
||||
The layout file contains a map of where Rinia can patch. The
|
||||
content consists of marker characters (where Rinia is allowed to
|
||||
change in the original text) and other characters (where the
|
||||
original text will stay as is). Rinia will select the marker
|
||||
character using these heuristics:
|
||||
|
||||
1. Ignore all space/control/extended characters.
|
||||
2. Select characters that appeared 8 times in a row.
|
||||
3. Of those selected characters, pick one with the lowest
|
||||
frequency.
|
||||
|
||||
One way to create the layout file is to make a copy of the original
|
||||
file, replace where you want Rinia to match with a rare character,
|
||||
then replace the remaining ones with space. Often it's possible to
|
||||
write the original file in such a way that it can be used as a
|
||||
layout.
|
||||
|
||||
Example file/layout:
|
||||
|
||||
file: layout:
|
||||
crc = ######## ... . XXXXXXXX
|
||||
patch = ###### ..... . XXXXXX
|
||||
other text here ..... .... ....
|
||||
|
||||
And Rinia may generate a file similar to this:
|
||||
|
||||
crc = 1bad73cf
|
||||
patch = #FR-QQ
|
||||
other text here
|
||||
|
||||
Note that the original file by itself is a valid layout file, since
|
||||
Rinia will recognize that only # marks enough space to hold the
|
||||
checksum, and has the lowest frequency.
|
||||
|
||||
If layout file can't be used for any reason, Rinia will say "bad
|
||||
layout" and exit immediately.
|
||||
|
||||
3. Output m
|
||||
|
||||
If Rinia finds a usuable checksum, she will say "OK." and write to
|
||||
the specified output file. Otherwise the exit message is "fail"
|
||||
and nothing is written.
|
||||
|
||||
Chances of success and how long it takes to run to completion is
|
||||
completely dominated by the layout file design. In general, Rinia
|
||||
runs faster if the checksum is placed before the other marker
|
||||
characters rather than after, e.g.:
|
||||
|
||||
a: X X XXX b: XXXXXXXX c: XXXXXXXX
|
||||
XXXXXXXX X X XXX XXXXX
|
||||
|
||||
"a" usually takes the longest time, while "c" usually is the
|
||||
fastest.
|
||||
|
||||
That said, each run is randomized with respect to system time, so
|
||||
it's not always certain whether Rinia will succeed in a short time
|
||||
or not. In general, 5 marker characters is sufficient, and takes
|
||||
a few minutes.
|
||||
|
||||
For reference, rinia.c was produced on a 1.7GHz machine (the
|
||||
checksum is at line 17). Out of 25 runs, the shortest was 2
|
||||
seconds while the longest took 5 minutes. Average was about a
|
||||
minute. Checksum for this file (b7a81524) took about 4 minutes.
|
||||
|
||||
4. Algorithm 3
|
||||
|
||||
Inserting a checksum in the file you are computing the checksum of
|
||||
isn't quite trivial, since changing the file content would change
|
||||
the final checksum value.
|
||||
|
||||
To insert the checksum, Rinia first assumes a random final
|
||||
checksum, insert that string, then modify other parts to compensate
|
||||
for the change in content.
|
||||
|
||||
The compensation bytes are very easy to compute for binary files
|
||||
with enough consecutive scratch areas, but for text files with
|
||||
non-consecutive areas and limited degrees of freedom, Rinia has to
|
||||
try out all character combinations. This is done in a hierarchical
|
||||
fashion, computing only smallest partial checksum after each
|
||||
change.
|
||||
|
||||
For computers few years ago, this is probably still too slow to be
|
||||
acceptible... but at the speed the IOCCC judges run the contest
|
||||
these days, I am sure you have enough patience for it ^_^;
|
||||
|
||||
5. Source code =
|
||||
|
||||
rinia.c should compile anywhere (but with a few warnings). I don't
|
||||
have a big-endian machine to test but Rinia should work there as
|
||||
well. ASCII character set required though.
|
||||
|
||||
Code is formatted to the shape of "Rinia" from the anime/game
|
||||
"Moekko Company". Of course at 90x50 it's hard to recognize anything
|
||||
^_^;
|
||||
|
||||
Rinia is the slow but hardworking android. On some jobs she does
|
||||
very well, on others she would spend lots of time and effort but
|
||||
still fail...
|
||||
|
||||
(text above is also included as an info file, so that the checksum
|
||||
would match)
|
||||
@@ -0,0 +1,121 @@
|
||||
Rinia (1/14/04)
|
||||
|
||||
Rinia is a tool for embedding CRCs in text files. No need to assign
|
||||
strange file names or package .SFVs with your files! Rinia will
|
||||
insert a human-readable checksum string in the text itself! ^_^
|
||||
|
||||
0. Usage `
|
||||
|
||||
rinia <infile> <layout> <outfile>
|
||||
|
||||
All three arguments may reference the same file. All files is
|
||||
assumed to be of ASCII character set.
|
||||
|
||||
1. Input %
|
||||
|
||||
Any file larger than 8 bytes is valid. Upper limit on file size is
|
||||
limited by memory.
|
||||
|
||||
If input file can't be loaded for any reason, Rinia will say "bad
|
||||
input" and exit immediately.
|
||||
|
||||
2. Layout _
|
||||
|
||||
The layout file contains a map of where Rinia can patch. The
|
||||
content consists of marker characters (where Rinia is allowed to
|
||||
change in the original text) and other characters (where the
|
||||
original text will stay as is). Rinia will select the marker
|
||||
character using these heuristics:
|
||||
|
||||
1. Ignore all space/control/extended characters.
|
||||
2. Select characters that appeared 8 times in a row.
|
||||
3. Of those selected characters, pick one with the lowest
|
||||
frequency.
|
||||
|
||||
One way to create the layout file is to make a copy of the original
|
||||
file, replace where you want Rinia to match with a rare character,
|
||||
then replace the remaining ones with space. Often it's possible to
|
||||
write the original file in such a way that it can be used as a
|
||||
layout.
|
||||
|
||||
Example file/layout:
|
||||
|
||||
file: layout:
|
||||
crc = ######## ... . XXXXXXXX
|
||||
patch = ###### ..... . XXXXXX
|
||||
other text here ..... .... ....
|
||||
|
||||
And Rinia may generate a file similar to this:
|
||||
|
||||
crc = 1bad73cf
|
||||
patch = #FR-QQ
|
||||
other text here
|
||||
|
||||
Note that the original file by itself is a valid layout file, since
|
||||
Rinia will recognize that only # marks enough space to hold the
|
||||
checksum, and has the lowest frequency.
|
||||
|
||||
If layout file can't be used for any reason, Rinia will say "bad
|
||||
layout" and exit immediately.
|
||||
|
||||
3. Output m
|
||||
|
||||
If Rinia finds a usuable checksum, she will say "OK." and write to
|
||||
the specified output file. Otherwise the exit message is "fail"
|
||||
and nothing is written.
|
||||
|
||||
Chances of success and how long it takes to run to completion is
|
||||
completely dominated by the layout file design. In general, Rinia
|
||||
runs faster if the checksum is placed before the other marker
|
||||
characters rather than after, e.g.:
|
||||
|
||||
a: X X XXX b: XXXXXXXX c: XXXXXXXX
|
||||
XXXXXXXX X X XXX XXXXX
|
||||
|
||||
"a" usually takes the longest time, while "c" usually is the
|
||||
fastest.
|
||||
|
||||
That said, each run is randomized with respect to system time, so
|
||||
it's not always certain whether Rinia will succeed in a short time
|
||||
or not. In general, 5 marker characters is sufficient, and takes
|
||||
a few minutes.
|
||||
|
||||
For reference, rinia.c was produced on a 1.7GHz machine (the
|
||||
checksum is at line 17). Out of 25 runs, the shortest was 2
|
||||
seconds while the longest took 5 minutes. Average was about a
|
||||
minute. Checksum for this file (b7a81524) took about 4 minutes.
|
||||
|
||||
4. Algorithm 3
|
||||
|
||||
Inserting a checksum in the file you are computing the checksum of
|
||||
isn't quite trivial, since changing the file content would change
|
||||
the final checksum value.
|
||||
|
||||
To insert the checksum, Rinia first assumes a random final
|
||||
checksum, insert that string, then modify other parts to compensate
|
||||
for the change in content.
|
||||
|
||||
The compensation bytes are very easy to compute for binary files
|
||||
with enough consecutive scratch areas, but for text files with
|
||||
non-consecutive areas and limited degrees of freedom, Rinia has to
|
||||
try out all character combinations. This is done in a hierarchical
|
||||
fashion, computing only smallest partial checksum after each
|
||||
change.
|
||||
|
||||
For computers few years ago, this is probably still too slow to be
|
||||
acceptible... but at the speed the IOCCC judges run the contest
|
||||
these days, I am sure you have enough patience for it ^_^;
|
||||
|
||||
5. Source code =
|
||||
|
||||
rinia.c should compile anywhere (but with a few warnings). I don't
|
||||
have a big-endian machine to test but Rinia should work there as
|
||||
well. ASCII character set required though.
|
||||
|
||||
Code is formatted to the shape of "Rinia" from the anime/game
|
||||
"Moekko Company". Of course at 90x50 it's hard to recognize anything
|
||||
^_^;
|
||||
|
||||
Rinia is the slow but hardworking android. On some jobs she does
|
||||
very well, on others she would spend lots of time and effort but
|
||||
still fail...
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
17th International Obfuscated C Code Contest Rules
|
||||
|
||||
Copyright (C) 2004 Leonid A. Broukhis, Simon Cooper, Landon Curt Noll and
|
||||
Peter Seebach.
|
||||
|
||||
All Rights Reserved. Permission for personal, education 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 the contest judges.
|
||||
|
||||
Obfuscate: tr.v. -cated, -cating, -cates. 1. a. To render obscure.
|
||||
b. To darken. 2. To confuse: his emotions obfuscated his
|
||||
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 the importance of programming style, in an ironic way.
|
||||
* To stress C compilers with unusual code.
|
||||
* To illustrate some of the subtleties of the C language.
|
||||
* To provide a safe forum for poor C code. :-)
|
||||
|
||||
The 17th IOCCC contest window is:
|
||||
|
||||
07-Jan-2004 00:00 UTC to 29-Feb-2004 23:59:59 UTC
|
||||
|
||||
RULES:
|
||||
|
||||
To help us with the volume of entries, we ask that you follow these rules:
|
||||
|
||||
1) Your entry must be a complete program.
|
||||
|
||||
2) The size of your program source must be <= 4096 bytes in length.
|
||||
The number of characters excluding whitespace (tab, space,
|
||||
newline, formfeed, return), and excluding any ; { or } immediately
|
||||
followed by whitespace or end of file, must be <= 2048.
|
||||
|
||||
3) Submissions should be performed using the instructions outlined at,
|
||||
|
||||
http://www.ioccc.org/2004/submit
|
||||
|
||||
NOTE: After 26-Jan-2004, 00:00 UTC an online submission mechanism will
|
||||
be available. See the above URL for details.
|
||||
|
||||
4) If your entry is selected as a winner, it will be modified as follows:
|
||||
|
||||
Your 'build' instructions will be incorporated into a
|
||||
makefile. If your build instructions *is* a makefile then
|
||||
it should be portable and usable from within a master
|
||||
makefile.
|
||||
|
||||
Your program source will be renamed using an identifier of
|
||||
our choice (usually your family name or anonymous) followed
|
||||
by an optional digit, followed by '.c'
|
||||
|
||||
Your entry will be compiled into a file with the above name
|
||||
minus the '.c'.
|
||||
|
||||
If your entry requires that a build file exist, state so in
|
||||
your entry's remark section. The makefile will be arranged to
|
||||
execute a build shell script containing the 'build'
|
||||
information. The name of this build shell script will be your
|
||||
entry's title, possibly followed by a digit, followed by '.sh'.
|
||||
|
||||
If needed, your entry's remarks should indicate how your entry
|
||||
must be changed in order to deal with the new filenames.
|
||||
|
||||
5) The build file, the source and the resulting executable should be
|
||||
treated as read-only files. If your entry needs to modify these files,
|
||||
it should make and modify a copy of the appropriate file. If this
|
||||
occurs, state so in your entry's remarks.
|
||||
|
||||
6) Your program source must be able to be compiled cleanly by an ANSI C
|
||||
compiler, or if there are any compile errors, they must be documented
|
||||
in the "remarks" section of your submission.
|
||||
|
||||
7) The program must be of original work. All submitted programs are
|
||||
are thereby put in the public domain. All explicitly copyrighted
|
||||
programs will be rejected.
|
||||
|
||||
8) Entries must be received prior to 29-Feb-2004 23:59:59 UTC. (UTC is
|
||||
essentially equivalent to Greenwich Mean Time).
|
||||
|
||||
An EMail a confirmation of submission will be sent to the sender
|
||||
before the close of the contest.
|
||||
|
||||
9) Each person may submit up to 8 entries per contest year. Each entry
|
||||
must be submitted separately.
|
||||
|
||||
10) Entries requiring human interaction to be built are not permitted.
|
||||
|
||||
11) Programs that require special privileges (setuid, setgid, super-user,
|
||||
special owner or group) are not permitted.
|
||||
|
||||
12) Legal abuse of the rules is somewhat encouraged. An entry that, in
|
||||
the opinion of the judges, violates the rules will be disqualified.
|
||||
Entries that attempt to abuse the rules must try to justify why
|
||||
their rule abuse is legal in the submitted "remarks".
|
||||
|
||||
13) Your source may not contain unescaped octets with the high bit set.
|
||||
I.e., your source may not contain octet values between 128 and 255.
|
||||
|
||||
14) Any program that fails to compile because of lines with trailing
|
||||
control-M's (\r or \015) will be rejected.
|
||||
|
||||
15) When you submit your entry you must have a valid email address
|
||||
that can both send and receive email. The online submission
|
||||
method is a two phase process that requires the use of an
|
||||
approval code. This code will be emailed to you as part of
|
||||
phase 1.
|
||||
|
||||
Entries submitted without a working or valid email address will
|
||||
be disqualified.
|
||||
|
||||
The judges are not responsible for delays in email, please plan
|
||||
enough time for one automated exchange of email as part of your
|
||||
submission.
|
||||
|
||||
16) You are STRONGLY encouraged to submit an original entry.
|
||||
Submissions that are similar to previous entries are discouraged.
|
||||
|
||||
FOR MORE INFORMATION:
|
||||
|
||||
The judging will be done by Leonid A. Broukhis, Simon Cooper, Landon
|
||||
Curt Noll and Peter Seebach. Please send questions or comments
|
||||
about the contest, to:
|
||||
|
||||
q.2004@ioccc.org (not the address for submitting entries)
|
||||
|
||||
You must include the words ``ioccc 2004 question'' in the subject of
|
||||
your EMail message when sending EMail to the judges.
|
||||
|
||||
The rules and the guidelines may (and often do) change from year to
|
||||
year. You should be sure you have the current rules and guidelines
|
||||
prior to submitting entries. To obtain them, visit the IOCCC web page:
|
||||
|
||||
http://www.ioccc.org
|
||||
|
||||
It has rules, guidelines and winners of previous contests (1984 to date).
|
||||
|
||||
Detail of how to submit your entry are located at,
|
||||
|
||||
http://www.ioccc.org/2004/submit
|
||||
@@ -0,0 +1,48 @@
|
||||
#include <stdio.h>
|
||||
#define l "=================================================="
|
||||
#define m " "
|
||||
int _(
|
||||
float x,
|
||||
float y){
|
||||
return x>=0&&x<50&&y>=0&&y<20;}
|
||||
int main (){
|
||||
char a[2][20][51],c[9][4][51][51],d[100];
|
||||
int e,f,g,h=0,i,j=0,k,b=0,n[9],o[9],p[9],x[9],y[9],q[9],r,s,t;
|
||||
float u[9],v[9],w[9],z[9];
|
||||
printf ("i%s\033Yppppppppppppppppppp1G0",l);
|
||||
do sprintf(a[0][j],"%s",m,
|
||||
sprintf (a[1][j],"%s",l));
|
||||
while (++j<20);
|
||||
scanf ("%d %d\n",&r,&s);
|
||||
gets (d);
|
||||
do {
|
||||
sscanf (d,"%d %d %f %f %f %f %d %d %d",&o[b],&p[b],&u[b],&v[b],&w[b],&z[b],&x[b],&y[b],&q[b],j=n[b]=i=0);
|
||||
do do c[b][i][j][x[b]]=!
|
||||
gets (c[b][i][j]);
|
||||
while (++j<y[b]);
|
||||
while (++i<q[b]+(j=0)||!++b);}
|
||||
while (
|
||||
gets (d)||(i=t=e=f=0));
|
||||
do {
|
||||
do strncpy(a[h][i],m,50);
|
||||
while (++i<20||(i=0));
|
||||
do if (t>=o[i]&&t<=p[i]&&!(k=j=0))
|
||||
do do if (_(u[i]+k,v[i]+j))a[h][(
|
||||
int )v[i]+j][(
|
||||
int )u[i]+k]=c[i][n[i]][j][k];
|
||||
while (++k<x[i]);
|
||||
while (++j<y[i]+(k=0)||((++n[i]-q[i]||(n[i]=0)),u[i]+=w[i],v[i]+=z[i],0));
|
||||
while (++i<b||(k=j=g=0));
|
||||
do do if (a[1-h][j][k]!=a[h][j][k]){f-j&&
|
||||
printf ("%dG0",j+1,e=0,g+=4);k&&e>k&&
|
||||
printf ("0%d ",k,g+=4);k&&e<k&&k-e>1&&
|
||||
printf ("%d ",k-e,g+=3);k&&e<k&&k-e==1&&
|
||||
printf (" ",g++);
|
||||
printf ("r%c",a[h][j][k],g+=2,e=k,f=j);}
|
||||
while (++k<50);
|
||||
while (++j<20+(k=0));
|
||||
do printf ("1G0",g+=3,e=f=0);
|
||||
while (g<s);h=1-h;}
|
||||
while (++t<=r+(i=0));
|
||||
return !
|
||||
puts ("");}
|
||||
@@ -0,0 +1,145 @@
|
||||
Best Non-Use of Curses:
|
||||
|
||||
Mark Schnitzius
|
||||
Eclipse Group
|
||||
94 Richardson St
|
||||
Albert Park, VIC 3206
|
||||
Australia
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make schnitzi
|
||||
|
||||
Try:
|
||||
|
||||
On some systems (Some sort of UNIX with "vim") try the following
|
||||
|
||||
./schnitzi <schnitzi.inp0 | vi
|
||||
./schnitzi <schnitzi.inp1 | vi
|
||||
|
||||
For others, create an output file and use your system
|
||||
pasteboard/selection/cut buffer to "input" the output into vi
|
||||
|
||||
./schnitzi <schnitzi.inp0 >schnitzi.out0
|
||||
./schnitzi <schnitzi.inp1 >schnitzi.out1
|
||||
|
||||
This exemplifies the meaning of Visual Editor, but we don't think
|
||||
that any benchmarking sites are going to use this to tout the
|
||||
performance of the latest hardware!
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
If you've ever pasted a large chunk of text into an editor (such as
|
||||
'vi') without first putting it into insert mode, or turning off
|
||||
the auto-indent, you know the dismay of watching your screen fill
|
||||
up with misaligned junk.
|
||||
|
||||
It's not the editor's fault. The editor is just acting just as if
|
||||
you typed exactly what you're pasting. (Of course, you could blame
|
||||
the editor for being modal in the first place, but that's a
|
||||
discussion for another time.)
|
||||
|
||||
It occurred to me that you could get interesting results by pasting
|
||||
a carefully designed string into the editor. In fact, if the pasted
|
||||
string contains cursor navigation commands, you can go back and
|
||||
overwrite things that were already inserted earlier in string,
|
||||
anywhere on the screen. Can you see where this is going?
|
||||
|
||||
|
||||
ANIMATION!
|
||||
|
||||
The program takes input from stdin which defines the animated
|
||||
elements (sprites) that appear on the screen. For each sprite,
|
||||
you can specify exactly when and how long it will appear, and which
|
||||
direction it is moving. Also, the sprite can oscillate between
|
||||
up to four different views, which appear in subsequent frames.
|
||||
Forgive me, animators, if I'm mangling the terminology. Sprites
|
||||
which appear later in the input file will be drawn in front of
|
||||
sprites which appear earlier.
|
||||
|
||||
The output, to stdout, is a string which, when pasted into vi, will
|
||||
perform the animation defined in the input. [The vi editor is a
|
||||
common (and ancient) editor that should be available on most Unix,
|
||||
Linux, Solaris, and Mac OS X machines; you can get it on Windows
|
||||
by installing Cygwin, which is how I do it.]
|
||||
|
||||
|
||||
THE INPUT
|
||||
|
||||
It's easiest to place the input in a file, so you can redirect it
|
||||
to stdin when running the program. What follows is a detailed
|
||||
description of the input file format.
|
||||
|
||||
The first line is specified thusly:
|
||||
|
||||
[duration] [timefactor]
|
||||
|
||||
The first parameter, duration, defines how long the animation will
|
||||
run. The second, timefactor, is used as sort of a fudge factor
|
||||
for machines that run too fast to see the animation. A timefactor
|
||||
of 0 means, "run the animation as fast as you can". On a pretty
|
||||
fast machine, I've had to set it as high as 2000 to get the
|
||||
animation to slow down sufficiently. Note that the higher the
|
||||
timefactor, the longer the output string that you'll have to copy-
|
||||
and-paste, as extra characters are necessary to "waste time" between
|
||||
frames.
|
||||
|
||||
Following the first line parameters, you may have up to nine
|
||||
different sprites, each up 50 by 50 in size, and with up to four
|
||||
different 'views' of that object, which are cycled through with
|
||||
each successive frame. Each sprite begins with a line of parameters
|
||||
of the following form:
|
||||
|
||||
[start] [end] [x] [y] [dx] [dy] [cols] [rows] [viewcount]
|
||||
|
||||
where:
|
||||
|
||||
'start' is the time at which this sprite first appears
|
||||
'end' is the time at which it disappears
|
||||
'x' is the horizontal position at which it starts
|
||||
'y' is the vertical position
|
||||
'dx' is the amount that the x position changes per frame
|
||||
'dy' is the amount that the y position changes per frame
|
||||
'cols' is the number of columns in each view
|
||||
'rows' is the number of rows in each view
|
||||
'viewcount' is the number of views to cycle through
|
||||
|
||||
Each such parameter line will be followed by 'viewcount'
|
||||
view frames, each with 'rows' rows and 'cols' columns.
|
||||
|
||||
Input is terminated by end of file. Duh.
|
||||
|
||||
Two samples input files are included; one a nice pastoral park
|
||||
scene, the other a bit of scrolling text.
|
||||
|
||||
|
||||
RUNNING THE ANIMATION
|
||||
|
||||
Try one of these methods to get the animation to run:
|
||||
|
||||
1. Redirect the output directly to vi, like this:
|
||||
|
||||
./schnitzi < input.dat | vi
|
||||
|
||||
2. Redirect the output to a file, like this:
|
||||
|
||||
./schnitzi < input.dat > output.dat
|
||||
|
||||
Then, open the output file, select the text, and copy it
|
||||
to your system pasteboard/cut/selection buffer and paste
|
||||
it into vi. The paste is NOT the vi paste command, but
|
||||
rather an action you take within your operating system.
|
||||
On a Windows machine running vi via Cygwin, "Edit|Paste"
|
||||
is a right-click menu option on the top window bar.
|
||||
|
||||
3. Memorize the output, and type it into vi really really fast.
|
||||
|
||||
|
||||
A FINAL NOTE
|
||||
|
||||
I would like to remind the Pixar Animation Studios that I retain
|
||||
royalties on this technique.
|
||||
@@ -0,0 +1,42 @@
|
||||
100 1000
|
||||
0 1000 0 10 0.0 0.0 50 2 1
|
||||
------------------------------\~~~~~~~~~~~~~~~~~~~
|
||||
\__________________
|
||||
0 1000 44 7 -0.1 0.0 7 4 1
|
||||
|\
|
||||
| \
|
||||
__----_
|
||||
\_____/
|
||||
0 90 40 2 -0.2 0.1 4 2 4
|
||||
_ _
|
||||
\/
|
||||
|
||||
____
|
||||
_/\_
|
||||
|
||||
|
||||
____
|
||||
0 1000 15 8 0.0 0.0 5 6 1
|
||||
*
|
||||
***
|
||||
*****
|
||||
***
|
||||
I
|
||||
I
|
||||
0 1000 2 12 0.5 0.0 8 3 1
|
||||
__o
|
||||
_ \<,_
|
||||
(_)/ (_)
|
||||
0 1000 20 10 0.0 0.0 5 6 1
|
||||
*
|
||||
***
|
||||
*****
|
||||
***
|
||||
I
|
||||
I
|
||||
0 1000 3 2 0.0 0.0 9 5 1
|
||||
\_|_/
|
||||
/ \
|
||||
-( :-) )-
|
||||
\___/
|
||||
/ | \
|
||||
@@ -0,0 +1,6 @@
|
||||
30 2000
|
||||
0 100 10 25 0.0 -1.0 25 4 1
|
||||
A long time
|
||||
ago, in a
|
||||
galaxy far, far
|
||||
away....
|
||||
+679
@@ -0,0 +1,679 @@
|
||||
#include<stdio.h>
|
||||
|
||||
/*
|
||||
|
||||
O
|
||||
b
|
||||
f u s
|
||||
c
|
||||
|
||||
a
|
||||
|
||||
t
|
||||
e
|
||||
|
||||
d
|
||||
*/
|
||||
|
||||
int m
|
||||
(
|
||||
|
||||
int
|
||||
|
||||
|
||||
c )
|
||||
|
||||
{
|
||||
|
||||
int
|
||||
|
||||
x
|
||||
|
||||
=
|
||||
3
|
||||
+
|
||||
|
||||
(
|
||||
c
|
||||
|
||||
-
|
||||
1
|
||||
)
|
||||
*
|
||||
|
||||
9
|
||||
|
||||
+
|
||||
(
|
||||
|
||||
c
|
||||
|
||||
-
|
||||
|
||||
1
|
||||
)
|
||||
|
||||
*
|
||||
27
|
||||
|
||||
+
|
||||
|
||||
(
|
||||
|
||||
c
|
||||
-
|
||||
|
||||
|
||||
1
|
||||
|
||||
)
|
||||
*
|
||||
(
|
||||
|
||||
|
||||
(
|
||||
993
|
||||
-
|
||||
'!'
|
||||
|
||||
*
|
||||
c
|
||||
|
||||
) /
|
||||
320
|
||||
|
||||
)
|
||||
+ (
|
||||
|
||||
c
|
||||
-
|
||||
|
||||
'9'
|
||||
+
|
||||
'8'
|
||||
)
|
||||
*
|
||||
c
|
||||
|
||||
+
|
||||
(
|
||||
|
||||
c
|
||||
-
|
||||
1
|
||||
)
|
||||
*
|
||||
243
|
||||
/
|
||||
9; return c
|
||||
-
|
||||
32
|
||||
?
|
||||
|
||||
c
|
||||
- 9 ?
|
||||
|
||||
c
|
||||
- 10
|
||||
?
|
||||
x
|
||||
% x : 3
|
||||
: 2
|
||||
|
||||
:
|
||||
1
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
a ,
|
||||
b ,
|
||||
|
||||
c
|
||||
|
||||
,
|
||||
d
|
||||
,
|
||||
e
|
||||
|
||||
|
||||
,
|
||||
|
||||
v,
|
||||
|
||||
f
|
||||
;
|
||||
|
||||
int
|
||||
main
|
||||
/* n
|
||||
(
|
||||
|
||||
c
|
||||
|
||||
)
|
||||
{ return
|
||||
c
|
||||
|
||||
++
|
||||
|
||||
-
|
||||
|
||||
32
|
||||
|
||||
|
||||
?
|
||||
|
||||
c
|
||||
-
|
||||
9
|
||||
|
||||
?
|
||||
|
||||
c
|
||||
|
||||
-
|
||||
|
||||
10
|
||||
|
||||
|
||||
?
|
||||
|
||||
0
|
||||
:
|
||||
|
||||
3 :
|
||||
|
||||
2
|
||||
|
||||
: 1
|
||||
;
|
||||
}
|
||||
|
||||
x
|
||||
|
||||
( )
|
||||
{
|
||||
|
||||
int
|
||||
a
|
||||
|
||||
,
|
||||
b ,
|
||||
c
|
||||
|
||||
,
|
||||
|
||||
d
|
||||
|
||||
,
|
||||
|
||||
|
||||
e
|
||||
|
||||
,
|
||||
v
|
||||
;
|
||||
|
||||
while
|
||||
|
||||
(
|
||||
|
||||
(
|
||||
|
||||
v
|
||||
|
||||
=
|
||||
putchar (
|
||||
|
||||
d )
|
||||
)
|
||||
|
||||
!= EOF
|
||||
)
|
||||
{ if
|
||||
(
|
||||
(
|
||||
|
||||
a
|
||||
=
|
||||
|
||||
m */
|
||||
( ) {
|
||||
while
|
||||
(
|
||||
(
|
||||
|
||||
e
|
||||
|
||||
= d
|
||||
= c
|
||||
=
|
||||
b
|
||||
|
||||
=
|
||||
v
|
||||
=
|
||||
getchar
|
||||
|
||||
(
|
||||
|
||||
)
|
||||
)
|
||||
-
|
||||
EOF
|
||||
)
|
||||
{ for
|
||||
( ;
|
||||
d
|
||||
<
|
||||
|
||||
0
|
||||
|
||||
;
|
||||
d
|
||||
++
|
||||
)
|
||||
{ f
|
||||
=
|
||||
f
|
||||
/
|
||||
getchar
|
||||
(
|
||||
)
|
||||
; a
|
||||
<<=
|
||||
f
|
||||
;
|
||||
(
|
||||
v
|
||||
*
|
||||
v
|
||||
* v
|
||||
|
||||
-
|
||||
|
||||
v
|
||||
||
|
||||
|
||||
e
|
||||
|
||||
*
|
||||
e *
|
||||
e
|
||||
-
|
||||
e
|
||||
)
|
||||
|
||||
&& (
|
||||
|
||||
e
|
||||
|
||||
|
||||
-
|
||||
|
||||
2
|
||||
||
|
||||
( d
|
||||
&
|
||||
|
||||
f
|
||||
)
|
||||
|
||||
-
|
||||
4 ||
|
||||
( a
|
||||
>> v
|
||||
!= (
|
||||
e -
|
||||
1 ?
|
||||
f
|
||||
:
|
||||
|
||||
0
|
||||
|
||||
|
||||
) )
|
||||
|
||||
) ;
|
||||
|
||||
} if
|
||||
|
||||
(
|
||||
|
||||
|
||||
( v %
|
||||
|
||||
v
|
||||
+
|
||||
|
||||
f *
|
||||
|
||||
--f
|
||||
+
|
||||
|
||||
v
|
||||
|
||||
) &&
|
||||
|
||||
( v
|
||||
|
||||
<
|
||||
|
||||
|
||||
f ? v /
|
||||
|
||||
v
|
||||
-
|
||||
|
||||
992 *
|
||||
|
||||
b
|
||||
:
|
||||
|
||||
v
|
||||
|
||||
*
|
||||
v ) &&
|
||||
|
||||
/*
|
||||
o
|
||||
|
||||
( c
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
return
|
||||
|
||||
c -
|
||||
|
||||
32
|
||||
?
|
||||
c
|
||||
|
||||
-
|
||||
|
||||
9 ?
|
||||
|
||||
c - 10
|
||||
|
||||
?
|
||||
|
||||
|
||||
0 : 3 : 2
|
||||
|
||||
:
|
||||
1
|
||||
|
||||
; }
|
||||
|
||||
y
|
||||
(
|
||||
|
||||
)
|
||||
|
||||
{
|
||||
int a ,
|
||||
|
||||
f
|
||||
,
|
||||
|
||||
b ,
|
||||
|
||||
c
|
||||
,
|
||||
|
||||
d
|
||||
|
||||
, e
|
||||
|
||||
,
|
||||
v
|
||||
;
|
||||
|
||||
while
|
||||
|
||||
(
|
||||
( v = getchar
|
||||
|
||||
(
|
||||
)
|
||||
|
||||
) !=
|
||||
|
||||
EOF
|
||||
)
|
||||
|
||||
{
|
||||
|
||||
if
|
||||
( ( a
|
||||
|
||||
=
|
||||
m
|
||||
|
||||
( c
|
||||
|
||||
)
|
||||
;
|
||||
|
||||
*/
|
||||
|
||||
( a
|
||||
|
||||
=
|
||||
m
|
||||
(
|
||||
|
||||
b
|
||||
|
||||
+ ++
|
||||
|
||||
f
|
||||
*
|
||||
3888
|
||||
|
||||
)
|
||||
|
||||
) &&
|
||||
|
||||
( b
|
||||
|
||||
=
|
||||
|
||||
|
||||
m ( getchar ( ) )
|
||||
|
||||
- f
|
||||
/
|
||||
|
||||
243 )
|
||||
|
||||
&&
|
||||
(
|
||||
|
||||
c
|
||||
|
||||
=
|
||||
m ( getchar
|
||||
|
||||
(
|
||||
)
|
||||
|
||||
) +
|
||||
|
||||
f
|
||||
)
|
||||
|
||||
&&
|
||||
|
||||
(
|
||||
|
||||
f
|
||||
==
|
||||
1
|
||||
|
||||
?
|
||||
|
||||
124
|
||||
- ( ( c
|
||||
|
||||
<
|
||||
8
|
||||
|
||||
&& (
|
||||
|
||||
(
|
||||
c
|
||||
|
||||
&
|
||||
|
||||
b
|
||||
) != e
|
||||
|
||||
||
|
||||
(
|
||||
|
||||
c >>
|
||||
|
||||
d
|
||||
)
|
||||
|
||||
!=
|
||||
|
||||
3888 )
|
||||
|
||||
)
|
||||
)
|
||||
:
|
||||
|
||||
1
|
||||
|
||||
) &&
|
||||
|
||||
(
|
||||
d
|
||||
=
|
||||
|
||||
m
|
||||
|
||||
(
|
||||
getchar ( ) + f
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
&& (
|
||||
|
||||
e
|
||||
=
|
||||
|
||||
m
|
||||
|
||||
(
|
||||
getchar ( )
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
) putchar (
|
||||
|
||||
f
|
||||
+
|
||||
|
||||
a
|
||||
|
||||
- 1
|
||||
|
||||
+
|
||||
(
|
||||
b
|
||||
|
||||
-
|
||||
|
||||
1
|
||||
) * ( (
|
||||
|
||||
993
|
||||
-
|
||||
|
||||
'!' )
|
||||
|
||||
/
|
||||
(
|
||||
|
||||
'('
|
||||
|
||||
*
|
||||
8 ) )
|
||||
|
||||
+
|
||||
(
|
||||
|
||||
c -
|
||||
|
||||
f
|
||||
-
|
||||
|
||||
'9'
|
||||
|
||||
+ '8'
|
||||
|
||||
)
|
||||
*
|
||||
9
|
||||
|
||||
-
|
||||
|
||||
4 +
|
||||
|
||||
(
|
||||
d
|
||||
-
|
||||
|
||||
1
|
||||
|
||||
) *
|
||||
|
||||
243
|
||||
/
|
||||
9
|
||||
|
||||
+
|
||||
|
||||
f +
|
||||
11
|
||||
|
||||
+
|
||||
|
||||
(
|
||||
|
||||
e -
|
||||
1
|
||||
|
||||
)
|
||||
* 3888 /
|
||||
|
||||
'0'
|
||||
-
|
||||
|
||||
7
|
||||
)
|
||||
; }
|
||||
return
|
||||
(
|
||||
|
||||
f
|
||||
|
||||
&&
|
||||
|
||||
getchar
|
||||
(
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
; }
|
||||
@@ -0,0 +1,95 @@
|
||||
Best Abuse of Indentation:
|
||||
|
||||
Stephen Sykes
|
||||
Laivalahdenportti 2
|
||||
00810 Helsinki
|
||||
Finland
|
||||
|
||||
http://www.stephensykes.com
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make sds
|
||||
|
||||
Try:
|
||||
|
||||
./sds < sds.c > encoder.c
|
||||
cc -o encoder encoder.c
|
||||
./encoder sds.hint <sds.c >sds_msg.c
|
||||
|
||||
Why not use the program to hide another program in the program? It
|
||||
must have seemed reasonable at the time.
|
||||
|
||||
The ability to hide a message in plain text is quite charming, really.
|
||||
We must admit to a bit of uncertainty about where you'd find such
|
||||
messages, or how useful they'd be. Or, of course, whether all those
|
||||
horribly badly formatted emails spammers send might contain secret
|
||||
messages. Annoyingly, it's a little too obvious that SOMETHING has
|
||||
been done to a message for us to hide one in the remarks. :)
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Steganography is the term for the family of techniques used for
|
||||
hiding information within other information. Today, it has many real
|
||||
world uses, particularly for digital watermarking.
|
||||
|
||||
This program uses a steganographic technique to hide information in
|
||||
any text file. The specific technique used is aimed at writers of
|
||||
obfuscated programs for the IOCCC, as the the hidden information is
|
||||
encoded in the whitespace in the source file. As we know, there are
|
||||
up to an additional 2048 characters of whitespace available to
|
||||
entrants to the IOCCC, so it turns out that this is an ideal place to
|
||||
hide things.
|
||||
|
||||
The program as provided is the steganographic decoder. Rather than
|
||||
provide a seperate encoding program, you should not be surprised to
|
||||
learn that I opted to steganographically hide the encoder inside the
|
||||
decoder.
|
||||
|
||||
Try it out. Compile the program, then type
|
||||
|
||||
sds < sds.c
|
||||
|
||||
You should see the encoder program displayed. Now save it, like:
|
||||
|
||||
sds < sds.c > encoder.c
|
||||
|
||||
Then compile encoder.c. You now have the complete system ready.
|
||||
|
||||
The encoder expects to get a filename as an argument. This filename
|
||||
is the name of the file containing the information to be hidden. It
|
||||
expects the file in which to hide the information to be on the
|
||||
standard input, and will output the results on the standard output.
|
||||
|
||||
You can use it like this (assuming you have a file called remarks):
|
||||
|
||||
echo 'Hello, World!' > message
|
||||
encoder message < remarks > remarks_msg
|
||||
|
||||
Then to decode:
|
||||
|
||||
sds < remarks_msg
|
||||
Hello, World!
|
||||
|
||||
C programs are mostly unaffected by adding steganographic content,
|
||||
but it is possible in certain circumstances for whitespace to be
|
||||
changed inside strings where it should be left alone. Plain text
|
||||
files are good candidates for hiding information in, but the added
|
||||
spacing may render the text somewhat difficult to read.
|
||||
|
||||
This program is obfuscated in a number of ways:
|
||||
|
||||
* The code is all but impossible to read due to the spacing
|
||||
* The algorithm is well hidden in the code due to copious red-herrings
|
||||
* The long expressions cause indentation tools to give poor results
|
||||
* And good old fashioned ternery operators are the icing on the cake
|
||||
|
||||
Compiling the program
|
||||
|
||||
The program (and the encoder program) should compile on any
|
||||
reasonable compiler. In particular, they are known to compile under
|
||||
GNU C.
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#define Z(a)main(a,T)
|
||||
Window L;
|
||||
#define J (K,
|
||||
GC N;
|
||||
#define I ; for(
|
||||
int g,h,i,j,k,l,m,n,p,q,r,v,w,x,y,z,
|
||||
#define W(a)(y/v*!w+((S+1)>>a&255)*(D+y/(z|w-2))/D)<<a|
|
||||
o,b,f,u,s,c,a,t,e,d, C
|
||||
#define U (struct timeval*)H
|
||||
[1<<18],A=100,B=4,D=200,E=53300,F=65793,H[4];
|
||||
#define V(a)#a": %1d'%02d\"%02d "
|
||||
Display*K; Pixmap M; char P[99]; int main
|
||||
#define Y(a,b)(a<b?a:b)
|
||||
(int S,char**T){
|
||||
#define X(a)\
|
||||
XDrawLine J M,N,D+l a m,o,D+l a n,o),
|
||||
XEvent O I p=E/5; --S&~1?
|
||||
XSetForeground J N,W(0)W(8)W(16)0),X(-)X(+)gettimeofday(U,0):S?z=97
|
||||
== ** ++ T,w=A==z[*T],B-=w[z+*T]%3,S:++S;
|
||||
XCopyArea J M,L,N,0,0,e,D,0,0),
|
||||
XSync J 0),
|
||||
XFlush (K),select(0,0,0,0,U+1)){ I 3[H]=F; p==++r?K=
|
||||
XOpenDisplay (0),N=
|
||||
XCreateGC J L=
|
||||
XCreateSimpleWindow J RootWindow(K,0),0,0,e=D*2,D,0,0,0),0,0),
|
||||
XSelectInput J L,KeyPressMask|KeyReleaseMask),
|
||||
XMapWindow J L),M=
|
||||
XCreatePixmap J L,e,d=D,DefaultDepth(K,0)),u=h=q=E:r<p?a=r/D%6,r[C
|
||||
+p]=(l+=!a|a%2?g:a-3)/4,r[C]=2*r<=p?(n+=(i-=(i+34&&r
|
||||
/149%B)-(i-34&&r/353%3)))/55:C[p-r],v=4-3*z:
|
||||
XPending (K)?C[F+
|
||||
XLookupKeysym (&O.xkey,0&
|
||||
XNextEvent J&O))]^=O.type==KeyPress||O.type==KeyRelease,p:0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Some more code */
|
||||
|
||||
|
||||
)I k=C[F+XK_Right]-C[F+XK_Left],j=k?j+v*k*(j*k<8):j*.9,u+=(s=Y(C[F+XK_space]*
|
||||
3+s-!!s,a))/9,c=u>p?q=Y(h,q),u%=p,Z(c=0):c,t+=j*(s+A)/e-s/i*(C[u+4]-C[u]),s=t
|
||||
*t>p?t*=.97,s*.8:g>a&&b*b<D*9?i:s,i=k=l=0,o=n=e; i-5; Z((k/17?o++==y?m=n=D,f
|
||||
-=A,o=30+9*i++:0,n-=2,m+=3,l=f/.7,y*F+A-i*k:k|!o?f=l=C[u]/-2-t,k+=17*w,o=k+++
|
||||
20,n=k+k-k*k/9,F*p:o--<a?y=135,A*F|D:0)))I x=g=m=f=0,a=i=u+D,d+=9; o<f?n=2*e,
|
||||
Z(z?r+k*F*8:E-k*A*A),n=9+x/D,Z(!k+z?r=D*F+9:A<<17),n-=x/9/D,Z(i%p>6?h=r*(3+z)
|
||||
/5:r),n=x/13/e,Z(k?h:r),o++:(f=x/D+70+C[i+p]-C[u+p],o=x?o:f,k=2*i/41%2,l=C[--
|
||||
i]-C[u]-t,x+=D-(y=i-u),g=(d-i)%410?g:(a=o,b=l+B*x/e,x)/A,i>u); )I k=i=0,x=g,
|
||||
l=b; ++i==41+!f&&k?f=k=i=l=0,x=190,a=163:i==42?i=9,k=r:!k|i-41; n=(Y(Y(Y(75,A
|
||||
-i)/3,95-2*i),r-k+2*i)-k/r)*x/D,m=i<9?x*14/D:k?(i-31)/5*(i%12)?0:n-1:0,o=a-i*
|
||||
x/D,y=D-o,h=Z(k*r+k*f/F))I B=g?B:1-h%3,i=60,y=n=m,XDrawString J M,N,30,x,P,
|
||||
sprintf(P,V(Time)V(High)"Speed: %03dmph",h/A/i,h/A%i,h%A,q/A/i,q/A%i,q%A,s,Z(
|
||||
A<<17))),x=h; ++f<2*z*e; l=(x*=3)%e,o=x*x%a,Z(-1)); } return A**H+1[H]/p-c; }
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
Best X11 Game:
|
||||
|
||||
Daniel Vik
|
||||
926 Genter Street
|
||||
La Jolla, Ca 92037
|
||||
USA
|
||||
|
||||
http://www.vik.cc/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
# you may have to edit the Makefile to set X11_LIBDIR correctly
|
||||
make vik1
|
||||
|
||||
Try:
|
||||
|
||||
# requires an X11 server
|
||||
./vik1
|
||||
./vik1 a
|
||||
./vik1 d2
|
||||
./vik1 ad3
|
||||
|
||||
Danial Vik has presented a tour de force feature rich X11-based
|
||||
racing game that fit within the contest size limits. Take a
|
||||
glace at the feature list he provided below. Amazing!
|
||||
|
||||
Happy touring on the road and in the code!
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
This program is a complete car race game with a lot of nice features:
|
||||
|
||||
* Drive on a road in a 3-d landscape with hills and curves
|
||||
|
||||
* Mountains in the horizon
|
||||
|
||||
* A sun in the sky when driving during the day.
|
||||
|
||||
* Dark sky and reduced visibility when driving at night.
|
||||
|
||||
* Snow when driving in the winter.
|
||||
|
||||
* Slippery road when driving in the winter.
|
||||
|
||||
* When driving off the road, the car slows down to a halt
|
||||
|
||||
* Three different race tracks that takes about one minute to
|
||||
complete.
|
||||
|
||||
* Speed meter.
|
||||
|
||||
* Computer driven opponent cars.
|
||||
|
||||
* Collision detection when driving into other cars.
|
||||
|
||||
* Lap time measurement.
|
||||
|
||||
* The best lap time is stored as reference.
|
||||
|
||||
|
||||
Build and Run
|
||||
=============
|
||||
|
||||
Compile the source code and link x libraries if necessary.
|
||||
The program takes three options which have to be typed in a specific
|
||||
order as described below.
|
||||
|
||||
Usage: vik1 ['a']['d'][#]
|
||||
|
||||
a - Advanced racing in a winter landscape
|
||||
d - Racing in at night in the dark
|
||||
# - Race track selection 1-3 are valid numbers
|
||||
|
||||
Here are a few examples:
|
||||
|
||||
Command line: Description:
|
||||
$ ./vik1 Run track 1 at daytime in the summer
|
||||
$ ./vik1 a Run track 1 at daytime in the winter
|
||||
$ ./vik1 d Run track 1 at night in the summer
|
||||
$ ./vik1 3 Run track 3 at daytime in the summer
|
||||
$ ./vik1 d3 Run track 3 at night in the summer
|
||||
$ ./vik1 ad2 Run track 2 at night in the winter
|
||||
|
||||
Note that the order in which the argument characters are entered is
|
||||
important. It is for example not possible to type ./vik1 da. (Well it is
|
||||
possible, but the result will not be as expected.)
|
||||
|
||||
The space key accelerates the car. Releasing the space key slowly
|
||||
reduces the speed. The left and right arrow keys are used to steer the
|
||||
car.
|
||||
|
||||
|
||||
Obfuscation
|
||||
===========
|
||||
|
||||
The main obfuscation is the fact that the program is extremely compact.
|
||||
There are a few things I didn't want to do, e.g. define #define to a
|
||||
single letter to save some space, or to remove casts to save some space.
|
||||
|
||||
The program uses a lot of variables. In fact, all letters a-z are used
|
||||
and most letters A-Z.
|
||||
|
||||
The constants are chosen very carefully and thy have multiple purposes,
|
||||
e.g. a constant can be both the length of the track and a color.
|
||||
|
||||
Most of the code is kept inside five for loops without body. Each for
|
||||
loop does many things. One for loop draws all cars by restarting a
|
||||
couple of times. Another draws the road, mountains, and the sun.
|
||||
|
||||
Main is called recursively. The return value and output depends on the
|
||||
arguments. main can return the current time, draw lines and of course be
|
||||
the entrypoint of the application.
|
||||
|
||||
The program frequently uses the ? operator mainly to save space but it
|
||||
makes the program more obscure.
|
||||
|
||||
|
||||
Compiler warnings
|
||||
=================
|
||||
|
||||
There are no compiler warnings when compiling with -ansi but there are
|
||||
quite many warnings from lclint. Mainly because the program is very
|
||||
optimized for code size.
|
||||
|
||||
|
||||
Limitations
|
||||
===========
|
||||
|
||||
The program only compiles and runs on X based systems.
|
||||
|
||||
The program requires a display with 24 bit color depth. It also assumes
|
||||
that the byte order of the colors are as on my Linux PC. That is, The
|
||||
colors are represented by a 32 bit value where the bytes (from high to
|
||||
low) are { 0, RED, GREEN, BLUE }.
|
||||
|
||||
+1028
File diff suppressed because it is too large.
Load diff
+207
@@ -0,0 +1,207 @@
|
||||
Best Abuse of CPP:
|
||||
|
||||
Daniel Vik
|
||||
926 Genter Street
|
||||
La Jolla, Ca 92037
|
||||
USA
|
||||
|
||||
http://www.vik.cc/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
make vik2
|
||||
|
||||
To run:
|
||||
|
||||
./vik2
|
||||
|
||||
The fun thing about CPP abuses is that, in most cases, running the
|
||||
preprocessor on them doesn't help you decipher the obfuscated code.
|
||||
That's assuming your preprocessor can take it at all.
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
It's been a while since the last pre-processor killer won the ioccc.
|
||||
I thought it was time to relive hour long compile times so I made a
|
||||
program that does (almost) all computation in the pre-processor. The
|
||||
program even causes gcc (and other pre-processors) to crash when
|
||||
configured to do maximum number of computations.
|
||||
The default configuration of the makefile is set to make the program
|
||||
compile in a not too long time.
|
||||
|
||||
I've got cpp to crash in a couple of diffenent ways. Most common is to
|
||||
get a segmentation fault, but a couple of times it just got stuck in
|
||||
some infinite loop.
|
||||
|
||||
I actually had to write my own pre-processor to verify that the program
|
||||
was doing the right thing...
|
||||
|
||||
Since it takes a very long time to compile the program, there is a
|
||||
symbol that can be defined to shorten the compile time and avoid
|
||||
compiler errors.
|
||||
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
The program implements an 11-bit ALU in the pre-processor. The ALU has
|
||||
two registers, X and Y, for calculations and one status register SR.
|
||||
Each bit in the registers are represented by one symbol that are either
|
||||
defined or undefined.
|
||||
|
||||
The ALU has six instructions:
|
||||
|
||||
CLR_X - Clear register X
|
||||
|
||||
CLR_Y - Clear register Y
|
||||
|
||||
ADD - Calculates X + Y and stores the result in X. If the result
|
||||
is larger than 11 bits, the CARRY bit in SR is set otherwise
|
||||
the CARRY bit is cleared.
|
||||
|
||||
SUB - Calculates X - Y and stores the result in X. If Y was larger
|
||||
than X, the CARRY bit in SR is set otherwise the CARRY bit
|
||||
is cleared.
|
||||
|
||||
TST - If X == Y the EQ bit in SR is set, otherwise the EQ bit is
|
||||
cleared. If X < Y the LT bit in SR is set, othervise the LT
|
||||
bit is cleared.
|
||||
|
||||
INC2 - Calculates X + 2 and stores the result in X. The CARRY bit
|
||||
is handled as in the ADD instruction.
|
||||
|
||||
Internally the ALU implements a one bit adder with a carry in and carry
|
||||
out. This adder is the core of the ALU. The ADD instruction uses the one
|
||||
bit adder to create the 11-bit adder. The SUB instruction is implemented
|
||||
by adding ~Y to X and then add 1. Finally the TST instruction calculates
|
||||
X-Y and checks the result and the CARRY bit in the SR register to set
|
||||
the EQ and LT bits.
|
||||
|
||||
All calculations are made using only the #ifdef, #infdef, #else, #endif,
|
||||
#define and #undef. I never assign a value to a defined symbol. The
|
||||
logic is done by assuming that a defined symbol is 1 and an undefined
|
||||
symbol is 0. (I guess this means that I have unlimited memory as long as
|
||||
I only store zeroes (!)).
|
||||
|
||||
The application that uses the pre-processor ALU is a prime number
|
||||
generator. The application uses the same pre-processor directives.
|
||||
Needed variables are stored in memory represended by one defined or
|
||||
undefined symbol per bit. When doing arithmetics, the variables are
|
||||
loaded into the X and Y registers by defining / undefining the X and Y
|
||||
register bits. Then the calcualtion is made and the result is moved back
|
||||
to the memory.
|
||||
|
||||
The choice of application may be a bit unfortunate since we've already
|
||||
seen a winning entry calculating prime nubmers in the pre-processor.
|
||||
There is a big difference though. The 1988 applin entry uses pre-
|
||||
processor arithmethic (in a very nice way though). This program only
|
||||
defines and undefines symbols in a well defined ;) way and doesn't do
|
||||
any pre-processor arithmetics.
|
||||
|
||||
The reason why I choosed to do a prime number application is that the
|
||||
algorithm can be written to do a lot of calculations without a lot of
|
||||
nesting (gnu cpp allows only 200 nested includes).
|
||||
|
||||
|
||||
Build and Run
|
||||
=============
|
||||
|
||||
First, do a first pre processing of the initial definitions. The FNAME
|
||||
symbol must be defined to the name of the output file. If you want to
|
||||
speed up the compilation, define the STOP symbol to anything from _3 to
|
||||
_10. (The default value is _10 which will make the compilation take some
|
||||
time.) Prime numbers up to 2^STOP will be calculated.
|
||||
|
||||
$ cpp '-DSTOP=_5' '-DFNAME="tmp1.c"' prog.c tmp1.c
|
||||
|
||||
Then use cpp or any other pre-processor to do the actual work. This will
|
||||
take some time....
|
||||
|
||||
$ cpp tmp1.c > tmp2.c
|
||||
|
||||
Finally compile the pre processed file
|
||||
|
||||
$ cc -O tmp2.c -o prog
|
||||
|
||||
Then run the program to reveil all prime numbers up to 32 (if you used
|
||||
STOP=_5 as above):
|
||||
|
||||
$ ./prog
|
||||
|
||||
|
||||
Verification
|
||||
============
|
||||
|
||||
I wasn't able to compile the full program which calculates prime numbers
|
||||
up to 1024 using gnu cpp (or any other pre-processor) so I had to write
|
||||
my own. Knowing how the program works it was quite easy to reduce the
|
||||
compilation time from several hours to about one second. I also added
|
||||
some statistics to my home made pre-processor and I found that
|
||||
calculating prime numbers up to 1024 makes the program include itself
|
||||
over 6.8 million times (see the statistics table below).
|
||||
|
||||
|
||||
Obfuscation
|
||||
===========
|
||||
|
||||
Well, since 98.5% of the program is preprocessor directives, the main
|
||||
obfuscation is the use of preprocessor directives.
|
||||
|
||||
Doing arithmetics without acutally using any arithmetic operations makes
|
||||
the program quite hard to follow.
|
||||
|
||||
In order to actually do the calculations, the program includes itself a
|
||||
lot.
|
||||
|
||||
The symbol names are made as short as possible to meet the space limits.
|
||||
This of course adds to the obfuscation (even though the program is
|
||||
quite obfuscated with longer, readable macro names.
|
||||
|
||||
Finally, I made the 1.5% c code a bit harder to read by breaking all
|
||||
lines after three characters.
|
||||
|
||||
The program has 1029 lines which makes it the longest entry (so far).
|
||||
|
||||
Even though the pre-processed and indented output is easier to read, it
|
||||
is quite hard to find the code in it. The size of the pre-processed file
|
||||
is several Mb when using gnu cpp.
|
||||
|
||||
|
||||
Limitations
|
||||
===========
|
||||
|
||||
In order to fit the program within the space limits, I had to define the
|
||||
#define, #endif, and some other directives as single character symbols.
|
||||
This does not compile on all pre-processors but using gnu cpp as a first
|
||||
compilation step solves this.
|
||||
|
||||
|
||||
Statistics
|
||||
==========
|
||||
|
||||
The table below contains some interesting statistics about the
|
||||
compilation of the program. The intermediate file size is the size of
|
||||
the output file of the cpp pre-processor. The time taken to pre process
|
||||
the program were measured using gnu cpp on my 2.0MHz P4 with 512Mb ram
|
||||
and a lot of disk.
|
||||
|
||||
Generated Recursive Max nest Intermediate
|
||||
Level prime nrs includes count file size Time
|
||||
|
||||
_3 < 8 2 322 9 74 748 4"
|
||||
_4 < 16 4 672 9 182 652 9"
|
||||
_5 < 32 14 237 9 629 121 32"
|
||||
_6 < 64 43 748 9 1 998 134 1'41"
|
||||
_7 < 128 149 851 11 6 823 575 5'50"
|
||||
_8 < 256 526 874 17 24 028 933 20'37"
|
||||
_9 < 512 1 920 272 38 65 527 808(*) 1h 42'19"(*)
|
||||
_10 < 1024 6 826 389 114 63 782 912(*) 2h 47'58"(*)
|
||||
|
||||
(*) Before cpp crashed.
|
||||
Reference in new issue
Block a user