Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Back in 2000, a winner of the International Obfuscated C Code Contest (IOCCC), had an implementation of an X-based graphical spreadsheet in 2kB of very unreadable C: http://www.ioccc.org/2000/jarijyrki.c . Details here: http://www.ioccc.org/2000/jarijyrki.hint


This is amazing. It compiles and runs under cygwin fine too.


How'd you get it to compile?

    gcc -I/usr/include/X11 jarijyrki.c  -o jarijyrki
    jarijyrki.c:15:33: error: ‘U’ undeclared here (not in a function)
    int   q,P,W,Z,X,Y,r,u; char   E[U][U][T+1] ,D[T];   Window J; GC k;  XEvent  w;
                                     ^


I downloaded the Makefile from the same site [1]. I changed CC to gcc (not sure if necessary) then just ran "make jarijyrki". The relevant build command makes it clear why your compile command fails.

   	${CC} ${X11CCFLAGS} ${CFLAGS} -DNeedFunctionPrototypes \
   	    -DU=40 -DT=98 '-Dz=(T+1)*U*U' -DQ=80 -DS=20 -DN=10 -DB=5 -DG=23 \
   	    -Dp=7 '-DM=((p+1)*Q)+S' '-DH=(G*S)+S+S' -DC=XK_Up -DL=XK_Down \
   	    -DO=XK_Left -DV=XK_Right -DR=XK_Escape -D_=XK_BackSpace \
   	    $? -o $@ ${X11LDFLAGS} -lX11
I guess there was a limitation on the length on the compilation command too and the winner made use of it fully. You have to run it as "./jarijyrki < sheet1.info > myedits.info", sheet1.info is in the same site[2].

[1] http://www.ioccc.org/2000/Makefile [2] http://www.ioccc.org/2000/sheet1.info


Oh geeze, I didn't even see there was a Makefile there .. sorry about that.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: