Add preview of 1984-2019

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

One will find HTML commented out with:

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

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

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

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

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

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

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
build: giljade
clean:
clobber:
-rm giljade
giljade: giljade.c
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
alt:
data:
+49
View File
@@ -0,0 +1,49 @@
#define/**/F/***/for/*A*/
#define/***/H()f=*E<<4|*\
E,f=~(f|f<<1|E[3]|E[1]|E\
[1]<<4|E[2]|E[(2)]<<(1));
#define/***/I(x,d)F(;s;C\
()){s=s^(b=s&s-1^s);F(N[\
4]=q=0;q<4;q++)N[q]=E[q]\
;N[5]=E-B;N[d]^=+b^(b)x;}
#define/**/o(p,t,i,m,a,l\
\
)u=(f&p)i(m) ;s=u&E[3];I(t(m),3)s=(u)a &E[l];I(t(m\
),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\
(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/
/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l
[9999],T=42, M,V=32;long*E,k[9999],B[1 <<+21],*N=B+
1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N
[3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]||
(B[h]=N-B,N= N+6);}main(char*U,int*w[] ){;;F(_=A=D+
6666,A[fread (A,1,3333,fopen(__FILE__, "r"))]=0;*++
_;h||(*_=V))
*_-59|_[1]-* _||(h&&(*_=+ 35),h---2||(_[9]=V));;F(_
=A;*_;_++)10 -*_&&*_-V&&( *_-92)&&(k[q]=isalnum(l[q
]=*_),q++);M =47;*(E=N-6) =64;E[1]=289;E[2]=270336;
F(E[3]=32782 ;E<N;E=E+6){ H()o(1048560,<<,>>,4,>>4,
1)o(+489335, >>,<<,1,,2)o (978670,<<,>>,1,>>1,2)o(+
65535,>>,<<, 4,,1)if(8192 &*E){F(N=B;E>B;E=B+E[5])*
N++=E-B;F(;N >B;){h=*(E=B +*--N);H()s=~(E[1]|h|h<<1
);u=~(E[2]|h |h<<4);r=l;_ =D;d=1;a=2;O=8;F(q=74;q;q
--){F(b=0;b< 72;b++){h=+1 <<(q-1)/14*4+(b-1)/18;j=b
?(!(b%18)&&u &h)|h&f|(!(q%14)&&s&h)?1:
0:2;if(O<3)O ?j?j-1&&(O-2 &&d--,*R=34,O=2):(*_++=O-
2?l[d]?l[d++ ]:(d=t,O=e=3 ,34):(O=1,34)):j||(*_++=d
<t?l[d++]:(O =1,d=0,34)); else{if(O<6)if(j){j-2|e||
(_=R,O-4?d-- :M-_[-1]||(_ [-1]=l[d++],O=3));c=0;if(
k[d]&k[d-1]) F(;k[d-1];++ c)d--;!d||((h=l[d])^l[d-1
])+k[d]||!(+ 40-(h&62)&&h -125)||(c=1,d--);c-1||(c=
2,d--);c&&(_ [-c]=M,_[1-c ]=T,O=4);j-2|e||(*_++=+92
);}else{h=*_ ++=O-4?O-5?l [d++]:(O=3,M):(O=5,T),(_[
-1]&&(35-h|| !(a=+1)))||( O=7,*(R=Q=_-(1))=M);}else
{j?O-7||(O=6
,_[-1]=59):( *_++=a-2?O-6 ?O-7?126&*++ r:(O=8,T):(O
=7,M):(a=0,l [d]-100?(e=1 ,O=0):(e=0,O =3,35)));if(
e==1){F(r=A= l+d;35-*A;++ A)*A-M&&*A-T ||U-1&&(*A=V
);d=d+A-r;if (U-1){*A=0;F (j=2;13499>j &&(sprintf(l
,r+1,j,j,O=j +75,w[1]),j= O,!system(l) ););exit(j<+
13499);}t=d+ 9;_[-1]=l[++ d];}a-1|+j-2 ||(R-Q<3?(*(
Q<R?R-1:R)=* Q=*R=59):(*R =M,R[-1]=T), a=2);}}j?(*_
++=j-2?V:10, R):(R=_-1);} }R[-1]=T;*R= M;*_++=10;F(
R=D;putchar( *R)&&_>++R;) ;}}};O-b-f-u -s-c-a-t-e;}
+158
View File
@@ -0,0 +1,158 @@
# Best 2D puzzle
Gil Dogon
1 HaBeer Alley
Jerusalem
Israel
gil_jade@netvision.net.il
## Judges' comments
This entry takes editorial in how it deals with its output. After using
vi to look at the source, use vi to look at its output. We especially
recommend it on a 78 column xterm while leaning on Control-F.
Do you really understand expressions, then understand this:
s=s^(b=s&s-1^s)
... and understand why it is found in the source code.
### To build
cc giljade.c -o giljade
### To run
giljade > out
Open an xterm with 78 lines
vi out
Press ^F repeatedly
## Author's comments
### So what do we have here ?
Just run the executable with no command line args and look at the output. In
order to properly enjoy it you will need two good old programs: xterm and vi.
Do the following: open an xterm with precisely 78 lines, and use the tiny font
size for best results. Then vi (vim will also do) the output. Type ^F's and
enjoy the show ...
The program solves (very very fast) a sliding block puzzle. There are many
variants of such puzzles which are usually made from wood or plastic pieces.
The start position can be recognized by looking at the program itself. The
goal is to move the big piece (2 by 2) to the center top, which takes 179
steps in the shortest move sequence.
Notice: the step count used by the program is longer than the traditional step
count for such puzzles, as normally if the same piece is moved twice in a row
it is counted as only one step, but here it is counted as two.
The printout of the solution however is in a rather unorthodox form, as can be
easily discerned. As you have probably suspected each of the steps in the
solution printout is a C program which compiles to result in - surprise
surprise! - the original (well almost).
Actually, This program is smarter than merely printing ITSELF in 180 different
layouts. It is self-improving, in that the programs it prints have three
advantages over the original:
1. Their layout is more precise (Notice the annoying \ at the 10'th line of
the original program which is actually a 'layout bug'
2. Their binary output does not rely on the source file being in the same
directory, and will not dump core like the original if it doesn't. :)
3. They have much more comments (Not very helpful ones though).
In addition as we all know bugs can creep on us in the most unexpected of
places, and checking that indeed the output is composed of 180 legal C
programs by hand can be quite tedious, hence the program also include a self-
test mode. Just run it with the output file as command line argument. It will
then try to compile each of the programs (printing the line number where the
program starts) It will stop where any compilation fails and the culprit
program would be in the file 'c.c'. The exit code of the self-test will be
non-zero in that case. In case this entry wins, I do hope nobody by the name
of 'c' also wins this year otherwise that part of the program would have to be
changed!
Notice that the self-test does not try to run the result of the compilations
but this can easily be done. try it and diff the output of any of the 180
results with the original output. Of course all 180 programs also include the
self-test mode.
### Why I think this program is obfuscated.
* Because its says so, and twice is better than once!
* All the usual suspects i.e. ?: && || , used to compress code length in the
noble tradition of this contest, meaningless one character variable names,
etc...
* The board representation is efficiently compressed hence obfuscated, and
the algorithm that is used to generate possible moves is extremely efficient.
In fact it can compute several moves in parallel on one processor! Moreover
Only the most efficient bitwise logical operations, shift,and subtraction by
one is used. No inefficient conditional tests and jumps are needed in that
part of the program.
* The single expression I'm most proud of, and would have submitted to the
category of 'best obfuscated short expression' if there was one is:
s=s^(b=s&s-1^s)
Can you figure out what it does (very efficiently) and how it fits in the
scheme of things?
* IMHO the program is easier to understand before running cpp on it. It is
also shorter that way to be sure.
* It even takes care to obfuscate the comments in the output programs.
* Having the output programs a bit different than the original is more
interesting.
* I have written an earlier version of the program about half a year ago and
when returning to it now I had to sweat quite a lot to understand the f***ing
mess I've made.
### Known Bugs/problems/warnings/portability issues
Some CPPs issue a warning about empty macro parameters.
-pedantic informs me that 'ISO C' does not allow extra ; outside of a
function, and I to this I say ISO what ???
-Wall of course will suggest adding a lot of parenthesis, function prototypes,
and remove some unnecessary expressions, and to this I say: if I listen to you
where is my freedom to obfuscate in style?
As mentioned earlier if you try to run the original program without its source
nearby it will dump core.
The program relies heavily on the ASCII coding system (have I seen this
comment before ?). It also implicitly assumes that sizeof(int) = sizeof(FILE
*). On systems when that is not the case expect a core dump...
### Challenges
What use are the ;; for ?
Why do I use 126& in the program? (except for the rather obvious fact that it
serves as comment obfuscater).
Why not write s^= instead of s=s^ In the expression I'm most proud of ?
What is 40-(h&62) doing ?
Use the program to solve for a different starting position. It is not that
difficult. Notice however that if there are more than two empty spaces the
outputs would not compile as the layout would not be sufficient to contain the
program.
Use the program to solve for board size different than 4*5. Thats a bit more
tricky.
### Hint for the challenges
Just try to change the program, and use the self test to see what happens ...