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

+41
View File
@@ -0,0 +1,41 @@
# 2006 makefile
#
# Copyright (C) 2006-2009, 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.
# Special flags for this entry
#
LOCAL_FLAGS= -I${X11_INCDIR} -L${X11_LIBDIR} -lX11 ${OPT}
# data files for this entry
#
DATA=
build: ${ENTRY} ${ENTRY}-sbar ${ENTRY}-txt
clean:
-${RM} ${ENTRY} ${ENTRY}-sbar ${ENTRY}-txt
clobber: clean
alt:
data:
${ENTRY}: ${ENTRY}.c ${DATA}
${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}.c -o ${ENTRY}
${ENTRY}-sbar: ${ENTRY}-sbar.c ${DATA}
${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}-sbar.c -o ${ENTRY}-sbar
${ENTRY}-txt: ${ENTRY}-txt.c ${DATA}
${CC} ${CFLAGS} ${LOCAL_FLAGS} ${ENTRY}-txt.c -o ${ENTRY}-txt
+107
View File
@@ -0,0 +1,107 @@
# Most Portable Chess Set
Oscar Toledo
Av. Santa Cruz del Monte 9-304
Ciudad Satelite. Edo. de Mexico
CP. 53110
Mexico
## Judges' Comments:
### To build:
make toledo3
NOTE: You may have to alter the paths suitably, and you do need X. Modify the makefile as needed.
### To run:
./toledo3 1
It's pretty obvious from looking at it what this program does,
since it's clearly spelled out in the code. The interesting
question is whether this is easier or harder to understand than
the code for Deep Blue.
## Selected Author's Comments:
There are so many text-based chess programs, what is that of
A1, H5, C4, D5? The queen is really pointing to the king?
So I managed to do a graphical X11 chess program (WYSIAIE, or
What You See Is An IOCCC Entry), point'n'click to move pieces
is the only required action, and of course the command-line
options:
./toledo3 Two-players mode
(useful if you don't have a board at hand)
./toledo3 1 Human white - Computer black, level 1 (fast)
./toledo3 2 Human white - Computer black, level 2 (medium)
./toledo3 3 Human white - Computer black, level 3 (slow)
./toledo3 1 b Human black - Computer white, level 1 (fast)
./toledo3 2 b Human black - Computer white, level 2 (medium)
./toledo3 3 b Human black - Computer white, level 3 (slow)
The computer will check that your moves are legal, full legal
chess moves are allowed, except minor promotions on human side.
The game will continue up to its logical conclusion, you make
a mistake and the computer surpasses you. ;)
### WHAT ABOUT THE ENGINE
Uses an alpha-beta search up to a depth of 3+level ply, extended
with quiescence search, that helps playing strength, something
around 1500 ELO (level 1) to 1700 ELO (level 3)
It searches the board and generates moves for each piece located,
a lot of comparisons are used for empassant, castling and
promotion. Would be faster with optimizations, but that
optimizations use valuable IOCCC characters.
It plays a different game every time, using the C library random
number generator.
Because it is resource-hungry, I strongly recommend to compile it
using maximum optimization, on GCC you can use:
gcc -O3 -fexpensive-optimizations prog.c -o prog -lX11
### KNOWN "FEATURES"
1. Because this is my second X11 program (the first was
point'n'click happy face), I added sentences everywhere
until it worked. :)
2. It is portable to Wind*ws (using the supplied layer.c file)
Change #include <X11/Xlib.h> to #include "layer.c" and
use a Wind*ws compiler (only tested with Dev C/C++ 4.9.9.2)
The play level is fixed, though you can change it easily.
Of course, this is an example of an obfuscated Wind*ws
program (there exists another way of write them?)
3. It will give warnings on compilation, so you can be sure
that your compiler works.
4. It will not update the window while it is "thinking"
5. The space character has many useful applications, specially
when it comes about the character limit. 8)
6. I still don't understand what to do after semicolons. :P
### CHALLENGES
It is possible to convert this code into Javascript with a
graphical interface. Can you do it?
Can the evaluation function be enhanced to make the program
play stronger?
### UPGRADES
Using toledo3-sbar.c (which is too large for this IOCCC size
rules) creates a status display about gameplay on the window title bar,
Using toledo3-txt.c turns this into being purely text based.
+30
View File
@@ -0,0 +1,30 @@
#include <windows.h>
#define main ma
#define Display int
#define XOpenDisplay(a)1
#define BlackPixel(a,b)2
#define WhitePixel(a,b)3
#define XCreateGC(a,b,c,d)4
#define Window HWND
#define XCreateSimpleWindow(a,b,c,d,e,f,g,h,i)CreateWindowEx(0,"a","Chess",\
0xcf0000,c,d,e+8,f+32,0,0,aa,0)
#define XSelectInput(a,b,c)
#define XMapWindow(a,b)ShowWindow(b,dd)
#define XCreateBitmapFromData(a,b,c,d,e)CreateBitmap(d,e,1,1,c)
#define XNextEvent(a,b){ MSG m; if(!GetMessage(&m,0,0,0))return \
m.wParam; TranslateMessage(&m); DispatchMessage(&m); *b=oo; oo.type=0; }
#define XCopyPlane(a,b,c,d,e,f,g,h,i,j,k)(h1=GetDC(c),h2=CreateCompatibleDC\
(h1),h3=SelectObject(h2,b),BitBlt(h1,i,j,g,h,h2,e,f,0xcc0020),SelectObject\
(h2,h3),DeleteDC(h2),ReleaseDC(c,h1))
#define XFlush(a)
typedef struct{ int foreground; } XGCValues;
typedef struct{ int type,x,y; } XButtonEvent;
HDC h1,h2,h3; XButtonEvent oo; HINSTANCE aa; int dd; LRESULT CALLBACK
WP(HWND h,UINT m,WPARAM w,LPARAM l){ if(m==513)oo.type=4,oo.x=LOWORD(l)
,oo.y=HIWORD(l); else if(m==15)oo.type=12; else if(m==2)PostQuitMessage(0);
else return DefWindowProc(h, m, w, l); return 0; } int WINAPI WinMain
(HINSTANCE a,HINSTANCE b,LPSTR c,int d){ static WNDCLASSEX w;
char*z[]={0,"1",0}; return aa=a,w.hInstance=a,w.lpszClassName="a",
w.lpfnWndProc=WP,w.cbSize=sizeof(WNDCLASSEX),dd=d,w.hIcon=LoadIcon(0,32512),
w.hIconSm=LoadIcon(0,32512),w.hCursor=LoadCursor(0,32512),w.hbrBackground=1,
RegisterClassEx(&w),main(2,z); }
+67
View File
@@ -0,0 +1,67 @@
#include <X11/Xlib.h>
char *l="dbcefcbddabcddcba~WAB+ +BAW~ +-84HLSU?A6J57IKJT576,",
*F=" ,>>,> xl~w/? ,>>>,s m\177>>\177\177 mm2>>> >uk>>> ",*f;y,u;
#define v for (i=0,b=0;b>511?b=0,i+=64:0,i<512;b+=64) A=i/64*10+b/64+21,XCopy\
Plane(d, r[I[A]+7+14*(i+b>>6&1)+28*(A==z)],w,C,0,0,64,64,b,i,1); XFlush(d);
#define _(a) *f++=a&*F?-(z%14<7):"U\252U\0DDDD"[z/14*2|u&1],
#define G(p) p##Pixel(d,DefaultScreen(d))
#define R(a) |(a==O|p==a)*
#define P return y=~y,
#define a X(0,0,0,
#define H while(
#define D ;if(
I[304],b,i,z;main(x,W) char**W; { Display *d =
XOpenDisplay(""); Window w = XCreateSimpleWindow
(d, DefaultRootWindow(d), 64,64,512,512,2,G(Black)
,G(Black)); XGCValues g; XButtonEvent e; int A,r
[56],Z,* m = I , C ,Y; XSelectInput(d,w,32772);
XMapWindow( d, w); g. foreground = G(White);
C=XCreateGC(d,w,4,&g); F+=48; H f=I,i=0,z<56){
H u=0,i++<8){ H _(0)_( 64)_(16)_(8)_(4)_(2)_(1
)_(0)++u<8); F++; } F-= z%7-6?z%14<6?16:0:8; r[
z++]=XCreateBitmapFromData(d,w,I,64,64); } srand(
time(z=u=0)); H I[z]=-( z>98|z<21|(z+1)%10<2),
++z<120); H ++m<9+I) 80 [m]=-2,90[m]=~(20[m]=7&*
l++),30[m]=1; D 1<x) Z= *W[1]-45; D 2<x){ a u,1
,Z); a u,0,1); z=0; } H 1){ XNextEvent(d,&e); D
e.type==12){ v } D e. type==4){ b=e.y/64*10+e
.x/64+21; D(b[I]^y)<-1) { z=b; v} else{ i=(b<29
|b>90)&((z[I]^y)==-2)?- 6^y:z[I]; Y=y; a u,0,1);
z=0; v D 1<x&&Y-y){ a u ,1,Z); a u,0,1); } z=0;
v Y=y,XStoreName(d,w,- 1e6>a u,1,1)?y=~y,a u,1,
0)>1e6?y?"Black's wins": "White's wins":"Stalemate"
:"Chess"),y=Y,z=0;} } } }
X(w,c,h,e,S,s)
{ int p,O= *l,t,d,o,C ,*g,E,n,*m =I,N=-1e8,
A,L,r,x = 10,q; y=~y ; H--O>20)
{ o=I[p=O] D q=o^y,q> 0){ q+=(q< 2)*y,C=q
["51#/+++"], A=q["95+3/33"]; do { m=0,
r=I[p+=C[l ]-64] D !w |p==w&&q>1 |C+2<A|!r)
{ d=abs(O- p) D g=q<2 &e>>6==p+(
y?x:-x)?I+ (e>>6):0, !r&(q>1|d% x<1||g)|(r
^y)<-1){ n =o,t=q<2&( 89<p|30>p)
?n+=y|1,6^ y:o+(y|1) D (r^y)<-6 ) P 1e7-811
*h; H n-t) { O[I]=0,p [I]=n,m?*g
=*m,*m=0:g ?*g=0:0; E=e&63 R( 91)16 R(28)
4 R(21)2 R (98)32; L= (q>1?6-q?l
[p/x-1]-l[ O/x-1]-q+2 :(E|=y?8:1 ,!!m)*9:(E
|=20-d?0: 64*p,n-o?( l[15+n]-' '
)*9:d/8+!! g*99))+(l[ r+15]-' ') *9+l[p%x]-
h-l[O%x]; L-=s>h||s== h&L>49&1<s
?X(s>h?0:p ,L,h+1,E,N ,s):0 D !( z-O|i-n|h|
p-b|S|L<- 1e6))return u=E; O[I]=
o,p[I]=r,m ?*m=*g,*g= 0:g?*g=-2^ y:0 D S|h&&
(L>N||!h&N ==L&&rand( )&4)){ N=L
D !h&&s) i =n,z=O,b=p D h&&c-L<S ) P L; } q
>5&d<2&C+6 <A&&(g=I+p ,r=I[p+=p-
O],m=p<O?g -3:g+2,!(e &(p<O?3:5) <<3*-y|*g|
r|m[p<O?1: -1])&&L>- 1e6&&1e6>a
63,1,0))?d ++:(n+=y|1 );} } } C +=q<2&C+3>
A&((y?O<80 :39<O)||r) ; } H!r&q>
2&q<6||(p= O,++C<A)) ; } } P N+ 1e8?N:0; }
+72
View File
@@ -0,0 +1,72 @@
char *l="dbcefcbddabcddcba~WAB+ +BAW~ +-84HLSU?A6J57IKJT576,";
#define F (getchar()&15)
#define R(a) |(a==O|p==a)*
#define P return y=~y,
#define a X(0,0,0,
#define H while(
#define D ;if(
I [
304]
,b,i,z,*m=I,
u,p,x =10,y;
main( W ) {
srand( time(
0)) ; H I
[z] =-(z>
98 |z<
21| (z+
1) %x<2
) , ++z <
120 ); H ++m
<9+ I)80 [m]
=- 2 ,
90[ m]=
~( m [20
]= 7 & *l
++ ) , 30[ m]=
1; H z=19){ H++ z<
100 ) putchar(z %x- 9?"KQRBNP .pnbrqk"
[7 +z [I]] :x ) D
x - ( z = F ) ) {
i = I [ z+= 100
-F* x] ; b =F;
b+= 100
-F* x ;
H x -(p
=F) ) i
=-p ^y
; } else a u, 1, 3+W); a
u , 0 , 1 ) ; } }
X(w,c,h,e,S,s)
{ int p,O= *l,t,d,o,C ,*g,E,n,*m =I,N=-1e8,
A,L,r,x = 10,q; y=~y ; H--O>20)
{ o=I[p=O] D q=o^y,q> 0){ q+=(q< 2)*y,C=q
["51#/+++"], A=q["95+3/33"]; do { m=0,
r=I[p+=C[l ]-64] D !w |p==w&&q>1 |C+2<A|!r)
{ d=abs(O- p) D g=q<2 &e>>6==p+(
y?x:-x)?I+ (e>>6):0, !r&(q>1|d% x<1||g)|(r
^y)<-1){ n =o,t=q<2&( 89<p|30>p)
?n+=y|1,6^ y:o+(y|1) D (r^y)<-6 ) P 1e7-811
*h; H n-t) { O[I]=0,p [I]=n,m?*g
=*m,*m=0:g ?*g=0:0; E=e&63 R( 91)16 R(28)
4 R(21)2 R (98)32; L= (q>1?6-q?l
[p/x-1]-l[ O/x-1]-q+2 :(E|=y?8:1 ,!!m)*9:(E
|=20-d?0: 64*p,n-o?( l[15+n]-' '
)*9:d/8+!! g*99))+(l[ r+15]-' ') *9+l[p%x]-
h-l[O%x]; L-=s>h||s== h&L>49&1<s
?X(s>h?0:p ,L,h+1,E,N ,s):0 D !( z-O|i-n|h|
p-b|S|L<- 1e6))return u=E; O[I]=
o,p[I]=r,m ?*m=*g,*g= 0:g?*g=-2^ y:0 D S|h&&
(L>N||!h&N ==L&&rand( )&4)){ N=L
D !h&&s) i =n,z=O,b=p D h&&c-L<S ) P L; } q
>5&d<2&C+6 <A&&(g=I+p ,r=I[p+=p-
O],m=p<O?g -3:g+2,!(e &(p<O?3:5) <<3*-y|*g|
r|m[p<O?1: -1])&&L>- 1e6&&1e6>a
63,1,0))?d ++:(n+=y|1 );} } } C +=q<2&C+3>
A&((y?O<80 :39<O)||r) ; } H!r&q>
2&q<6||(p= O,++C<A)) ; } } P N+ 1e8?N:0; }
+65
View File
@@ -0,0 +1,65 @@
#include <X11/Xlib.h>
char *l="dbcefcbddabcddcba~WAB+ +BAW~ +-84HLSU?A6J57IKJT576,",
*F=" ,>>,> xl~w/? ,>>>,s m\177>>\177\177 mm2>>> >uk>>> ",*f;y,u;
#define v for (i=0,b=0;b>511?b=0,i+=64:0,i<512;b+=64) A=i/64*10+b/64+21,XCopy\
Plane(d, r[I[A]+7+14*(i+b>>6&1)+28*(A==z)],w,C,0,0,64,64,b,i,1); XFlush(d);
#define _(a) *f++=a&*F?-(z%14<7):"U\252U\0DDDD"[z/14*2|u&1],
#define G(p) p##Pixel(d,DefaultScreen(d))
#define R(a) |(a==O|p==a)*
#define P return y=~y,
#define a X(0,0,0,
#define H while(
#define D ;if(
I[304],b,i,z;main(x,W) char**W; { Display *d =
XOpenDisplay(""); Window w = XCreateSimpleWindow
(d, DefaultRootWindow(d), 64,64,512,512,2,G(Black)
,G(Black)); XGCValues g; XButtonEvent e; int A,r
[56],Z,* m = I , C ,Y; XSelectInput(d,w,32772);
XMapWindow( d, w); g. foreground = G(White);
C=XCreateGC(d,w,4,&g); F+=48; H f=I,i=0,z<56){
H u=0,i++<8){ H _(0)_( 64)_(16)_(8)_(4)_(2)_(1
)_(0)++u<8); F++; } F-= z%7-6?z%14<6?16:0:8; r[
z++]=XCreateBitmapFromData(d,w,I,64,64); } srand(
time(z=u=0)); H I[z]=-( z>98|z<21|(z+1)%10<2),
++z<120); H ++m<9+I) 80 [m]=-2,90[m]=~(20[m]=7&*
l++),30[m]=1; D 1<x) Z= *W[1]-45; D 2<x){ a u,1
,Z); a u,0,1); z=0; } H 1){ XNextEvent(d,&e); D
e.type==12){ v } D e. type==4){ b=e.y/64*10+e
.x/64+21; D(b[I]^y)<-1) { z=b; v} else{ i=(b<29
|b>90)&((z[I]^y)==-2)?- 6^y:z[I]; Y=y; a u,0,1);
z=0; v D 1<x&&Y-y){ a u ,1,Z); a u,0,1); } z=0;
v } } } }
X(w,c,h,e,S,s)
{ int p,O= *l,t,d,o,C ,*g,E,n,*m =I,N=-1e8,
A,L,r,x = 10,q; y=~y ; H--O>20)
{ o=I[p=O] D q=o^y,q> 0){ q+=(q< 2)*y,C=q
["51#/+++"], A=q["95+3/33"]; do { m=0,
r=I[p+=C[l ]-64] D !w |p==w&&q>1 |C+2<A|!r)
{ d=abs(O- p) D g=q<2 &e>>6==p+(
y?x:-x)?I+ (e>>6):0, !r&(q>1|d% x<1||g)|(r
^y)<-1){ n =o,t=q<2&( 89<p|30>p)
?n+=y|1,6^ y:o+(y|1) D (r^y)<-6 ) P 1e7-811
*h; H n-t) { O[I]=0,p [I]=n,m?*g
=*m,*m=0:g ?*g=0:0; E=e&63 R( 91)16 R(28)
4 R(21)2 R (98)32; L= (q>1?6-q?l
[p/x-1]-l[ O/x-1]-q+2 :(E|=y?8:1 ,!!m)*9:(E
|=20-d?0: 64*p,n-o?( l[15+n]-' '
)*9:d/8+!! g*99))+(l[ r+15]-' ') *9+l[p%x]-
h-l[O%x]; L-=s>h||s== h&L>49&1<s
?X(s>h?0:p ,L,h+1,E,N ,s):0 D !( z-O|i-n|h|
p-b|S|L<- 1e6))return u=E; O[I]=
o,p[I]=r,m ?*m=*g,*g= 0:g?*g=-2^ y:0 D S|h&&
(L>N||!h&N ==L&&rand( )&4)){ N=L
D !h&&s) i =n,z=O,b=p D h&&c-L<S ) P L; } q
>5&d<2&C+6 <A&&(g=I+p ,r=I[p+=p-
O],m=p<O?g -3:g+2,!(e &(p<O?3:5) <<3*-y|*g|
r|m[p<O?1: -1])&&L>- 1e6&&1e6>a
63,1,0))?d ++:(n+=y|1 );} } } C +=q<2&C+3>
A&((y?O<80 :39<O)||r) ; } H!r&q>
2&q<6||(p= O,++C<A)) ; } } P N+ 1e8?N:0; }