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

+204
View File
@@ -0,0 +1,204 @@
#!/usr/bin/env make
#
# 2013 makefile
#
# This work by Landon Curt Noll, Simon Cooper, and Leonid A. Broukhis
# is licensed under:
#
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
#
# See: http://creativecommons.org/licenses/by-sa/3.0/
################
# tool locations
################
#
SHELL= /bin/bash
CP= cp
CPP= cpp
GUNZIP= gunzip
LD= ld
MAKE= make
RM= rm
SED= sed
TAR= tar
TRUE= true
# Set X11_LIBDIR to the directory where the X11 library resides
#
X11_LIBDIR= /usr/X11R6/lib
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
#
X11_INCDIR= /usr/X11R6/include
# Compiler warnings
#
#CWARN=
#CWARN= -Wall -W
CWARN= -Wall -Wextra -Wshadow -pedantic \
-Wno-variadic-macros -Wno-string-plus-int
# compiler standard
#
#CSTD=
#CSTD= -ansi
CSTD= -std=c99
# compiler bit architecture
#
# Some entries require 32-bitness:
# ARCH= -m32
#
# Some entries require 64-bitess:
# ARCH= -m64
#
# By default we assume nothing:
#
ARCH=
# optimization
#
# Most compiles will safely use -O2. Some can use only -O1 or -O.
# A few compilers have broken optimizers or this entry make break
# under those buggy optimizers and thus you may not want anything.
#
#OPT=
#OPT= -O
#OPT= -O1
OPT= -O2
#OPT= -O3
# Libraries needed to build
#
LIBS= -lncurses -lX11
# default flags for ANSI C compilation
#
CFLAGS= ${CWARN} ${CSTD} ${ARCH} -I/opt/X11/include -L/opt/X11/lib ${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
#CC=clang
MAY_NEED_GCC= gcc
##############################
# Special flags for this entry
##############################
#
ENTRY= morgan2
DATA=
ALT_OBJ=
ALT_ENTRY=
#################
# build the entry
#################
#
all: ${ENTRY} ${DATA}
@${TRUE}
${ENTRY}: ${ENTRY}.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable
#
alt: ${ALT_ENTRY}
@${TRUE}
# data files
#
data: ${DATA}
@${TRUE}
###############
# utility rules
###############
#
everything: all alt
clean:
${RM} -f ${ENTRY}.o ${ALT_OBJ}
clobber: clean
${RM} -f ${ENTRY} ${ALT_ENTRY}
nuke: clobber
@${TRUE}
dist_clean: nuke
@${TRUE}
install:
@echo "Surely we are joking Dr. Lehmer!"
@${TRUE}
# backwards compatibility
#
build: all
@${TRUE}
##################
# 133t hacker rulz
##################
#
love:
@echo 'not war?'
@${TRUE}
haste:
$(MAKE) waste
@${TRUE}
waste:
@echo 'haste'
@${TRUE}
easter_egg:
@echo you expected to mis-understand this $${RANDOM} magic
@echo chongo '<was here>' "/\\oo/\\"
@echo Readers shall not be disallowed from being unable to not partly misunderstand this partocular final echo.
# Understand the history of the Homebrew Computer Club
# as well as the West Coast Computer Faire and
# you might be confused different. :-)
#
supernova: nuke
@-if [ -r .code_anal ]; then \
${RM} -f .code_anal_v4; \
else \
echo "We are not expected to understand that"; \
fi
@${TRUE}
deep_magic:
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 2ed3582ec5c094a093fea2a6bcb9f19439892873c9cc45ed1ceaafe08b7d52e1b2c7cd524be3b0b2 --FNV1a_hash 512-bit "${ENTRY}"; \
else \
echo "Park different"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --mode 391581 --level 216193 --FNV1a_hash 512-bit "${ENTRY}"; \
else \
echo "These aren't the primes you're looking for Paul Erdos!"; \
fi
@${TRUE}
+170
View File
@@ -0,0 +1,170 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="GENERATOR" content="mkd2html 2.1.5a DL=DISCOUNT">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<link rel="stylesheet"
type="text/css"
href="../hint.css">
<title>Most playfully versatile</title>
</head>
<body>
<h1>Most playfully versatile</h1>
<p>Yves-Marie Morgan<br>
<a href="&#x6d;&#97;&#105;&#x6c;&#116;&#x6f;&#x3a;&#121;&#118;&#101;&#x73;&#45;&#x6d;&#x61;&#114;&#105;&#101;&#x2e;&#109;&#x6f;&#x72;&#x67;&#x61;&#x6e;&#64;&#x70;&#97;&#114;&#x72;&#111;&#x74;&#46;&#99;&#x6f;&#109;">&#121;&#118;&#x65;&#115;&#x2d;&#x6d;&#x61;&#x72;&#105;&#101;&#x2e;&#109;&#x6f;&#114;&#103;&#97;&#110;&#x40;&#112;&#x61;&#114;&#x72;&#x6f;&#116;&#46;&#99;&#x6f;&#x6d;</a></p>
<h2>Judges' comments:</h2>
<h3>To build:</h3>
<pre><code> make morgan2
</code></pre>
<h3>To run:</h3>
<pre><code>./morgan2
</code></pre>
<p>For the console version (ncurses)</p>
<p>or</p>
<pre><code>./morgan2 X
</code></pre>
<p>For the graphical version (X11)</p>
<h3>Selected Judges Remarks:</h3>
<p>The judges enjoyed playing the game almost to completion; if we remember correctly,
we managed to place 59 or 60 dominos. We wonder, what would be faster: to play the game to completion
or to write an unobfuscated version of it?</p>
<h2>Author&rsquo;s comments:</h2>
<p>This program is a domino game. The goal is to place dominos on the 8x8 grid.
Each domino is made of 6 squares of the color red or green. To place a domino,
at least one of it side shall match the other side of another domino.</p>
<h1>How to play</h1>
<h2>Start of the game</h2>
<p>At the start of the game, the first domino is placed randomly on the grid. You
get another domino to place by selecting one empty position in the stack on the
right. You can have to 8 dominos pending at any time.</p>
<h2>Moving in the stack</h2>
<p>Use <code>Up</code> and <code>Down</code> key to move the cursor in the stack. Press <code>Enter</code> to either</p>
<ul>
<li>reveal a new domino if the position was empty.</li>
<li>select the domino to try to place it if the position was not empty.</li>
</ul>
<p>The currently selected domino is indicated on the top right.</p>
<h2>Placing a domino</h2>
<p>Once a domino has been selected, the cursor moves to the grid. Use <code>Up</code>, <code>Down</code>,
<code>Left</code> and <code>Right</code> keys to move in the grid. Press <code>Enter</code> on an empty position
to place the domino.</p>
<p>To go back to selection mode, press <code>Enter</code> on an occupied position.</p>
<p>The domino can be place in an empty position if all its neighbour have matching
sides and the domino has at least one neighbour.</p>
<h2>Scoring</h2>
<p>First, depending on the number of dominos pending in the stack, a bonus is
accorded :
* 1 domino in the stack : 8 points.
* 2 dominos in the stack : 4 points.
* 3 or 4 dominos in the stack : 2 points.
* 5 or more dominos in the stack : 0 point.</p>
<p>Then the bonus is multiplied by the number of matching neighbor the placed domino
has (1, 2, 3 or 4). This is added to the score.</p>
<p>Finally, the total score is divided by the number of dominos placed (1 - 64).</p>
<p>The 3 numbers on display represent : the total score, the fill count and the
final score (total score divided by fill count).</p>
<h2>End of the game</h2>
<p>The game is finished when no more domino can be placed and you either :
* filled the complete grid.
* have 8 pending dominos in the stack.
* no more domino can be revealed in the stack (more than 56 dominos placed on
the grid).</p>
<p><strong>Note</strong> There is no real end of game detection implemented in the program,
simply press <code>q</code> when you have finished&hellip;</p>
<h2>Strategy</h2>
<ul>
<li>Try to minimize the number of dominos revealed in the stack. The lower the number,
the higher the bonus.</li>
<li>Each domino is unique and all combination of colors exists, so keep track
of what is already place and what is left.</li>
<li>Make sure you don&rsquo;t render dead some positions by preventing a future placement
If the corner of domino does not match another corner in diagonal, the move
is valid but will prevent some future moves.</li>
</ul>
<h1>Limitations</h1>
<ul>
<li>ASCII character set is assumed.</li>
<li>Requires both ncurses and X11 at compilation and runtime, but selection could
be done at compilation with some extra code (mainly empty stubs).</li>
</ul>
<h1>Obfuscation</h1>
<ul>
<li>1 letter identifier, reused when possible.</li>
<li>1 algorithm, 2 different kind of display (ncurses and X11) mixed.</li>
<li>No parameters to functions, all variables are global and shared.</li>
<li>Some variables are not initialized if they have a known value at the time of use.</li>
</ul>
<h1>Compilation warnings</h1>
<p>with gcc 4.7.2 on Linux Ubuntu 12.10 :
* prog.c:46:65: warning: value computed is not used [-Wunused-value]</p>
<p>with clang 3.1 on Linux Ubuntu 12.10 :
* prog.c:23:24: warning: adding &lsquo;int&rsquo; to a string does not append to the string [-Wstring-plus-int]</p>
<p><strong>!!!!! HAVE FUN !!!!!</strong></p>
<hr />
<!--
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->
<TABLE><TR>
<TD><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a></TD>
<TD><P>&copy; Copyright 1984-2015,
<A HREF="/judges.html">Leo Broukhis, Simon Cooper, Landon Curt Noll</A>
- All rights reserved<BR>
This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</P></TD>
<TD>&nbsp;<!--<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>--></TD>
</TR></TABLE>
</body>
</html>
+136
View File
@@ -0,0 +1,136 @@
# Most playfully versatile
Yves-Marie Morgan
<yves-marie.morgan@parrot.com>
## Judges' comments:
### To build:
make morgan2
### To run:
./morgan2
For the console version (ncurses)
or
./morgan2 X
For the graphical version (X11)
### Selected Judges Remarks:
The judges enjoyed playing the game almost to completion; if we remember correctly,
we managed to place 59 or 60 dominos. We wonder, what would be faster: to play the game to completion
or to write an unobfuscated version of it?
## Author's comments:
This program is a domino game. The goal is to place dominos on the 8x8 grid.
Each domino is made of 6 squares of the color red or green. To place a domino,
at least one of it side shall match the other side of another domino.
# How to play
## Start of the game
At the start of the game, the first domino is placed randomly on the grid. You
get another domino to place by selecting one empty position in the stack on the
right. You can have to 8 dominos pending at any time.
## Moving in the stack
Use `Up` and `Down` key to move the cursor in the stack. Press `Enter` to either
* reveal a new domino if the position was empty.
* select the domino to try to place it if the position was not empty.
The currently selected domino is indicated on the top right.
## Placing a domino
Once a domino has been selected, the cursor moves to the grid. Use `Up`, `Down`,
`Left` and `Right` keys to move in the grid. Press `Enter` on an empty position
to place the domino.
To go back to selection mode, press `Enter` on an occupied position.
The domino can be place in an empty position if all its neighbour have matching
sides and the domino has at least one neighbour.
## Scoring
First, depending on the number of dominos pending in the stack, a bonus is
accorded :
* 1 domino in the stack : 8 points.
* 2 dominos in the stack : 4 points.
* 3 or 4 dominos in the stack : 2 points.
* 5 or more dominos in the stack : 0 point.
Then the bonus is multiplied by the number of matching neighbor the placed domino
has (1, 2, 3 or 4). This is added to the score.
Finally, the total score is divided by the number of dominos placed (1 - 64).
The 3 numbers on display represent : the total score, the fill count and the
final score (total score divided by fill count).
## End of the game
The game is finished when no more domino can be placed and you either :
* filled the complete grid.
* have 8 pending dominos in the stack.
* no more domino can be revealed in the stack (more than 56 dominos placed on
the grid).
**Note** There is no real end of game detection implemented in the program,
simply press `q` when you have finished...
## Strategy
* Try to minimize the number of dominos revealed in the stack. The lower the number,
the higher the bonus.
* Each domino is unique and all combination of colors exists, so keep track
of what is already place and what is left.
* Make sure you don't render dead some positions by preventing a future placement
If the corner of domino does not match another corner in diagonal, the move
is valid but will prevent some future moves.
# Limitations
* ASCII character set is assumed.
* Requires both ncurses and X11 at compilation and runtime, but selection could
be done at compilation with some extra code (mainly empty stubs).
# Obfuscation
* 1 letter identifier, reused when possible.
* 1 algorithm, 2 different kind of display (ncurses and X11) mixed.
* No parameters to functions, all variables are global and shared.
* Some variables are not initialized if they have a known value at the time of use.
# Compilation warnings
with gcc 4.7.2 on Linux Ubuntu 12.10 :
* prog.c:46:65: warning: value computed is not used [-Wunused-value]
with clang 3.1 on Linux Ubuntu 12.10 :
* prog.c:23:24: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
**!!!!! HAVE FUN !!!!!**
--------------------------------------------------------------------------------
<!--
(c) Copyright 1984-2015, [Leo Broukhis, Simon Cooper, Landon Curt Noll][judges] - All rights reserved
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License][cc].
[judges]: http://www.ioccc.org/judges.html
[cc]: http://creativecommons.org/licenses/by-sa/3.0/
-->
+65
View File
@@ -0,0 +1,65 @@
#include <stdlib.h>
#include <curses.h>
#include <time.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#define F(x,y,w,h,c) G(c),XFillRectangle(A,B,D,x,y,w,h),G(3)
#define G(c) XSetForeground(A,D,C[c].pixel)
#define H(d) addch(y?y-e?ACS_VLINE:ACS_L##d:ACS_U##d)
#define I(i,c) init_pair(i,COLOR_##c,COLOR_##c)
#define J(a,b) j==X[(int[]){ KEY_##b,XK_##a} ]
#define K(q,r,s,t,u,v,w) (q=!!(w)*z[p v]>>8,(1<<(3*!!((((r)>>t)^(s))&u)))*!!q)
#define L z[p=rand()&63]
int c[9],e,f,g, h,i,j,k,l,m,n,q ,r,s,t,u,v,w,x,
y,X, z[64]; GC D; Display * A; Window B; char
o[]="tdpsf\73!" "&e!&e!&e\1",*Y =o,b[64];XColor
C[8]; XEvent E; int R ( ) { XDrawString(A,B
,D,348,58, b, e ); XNextEvent ( A, &E); return
XLookupKeysym(& E.xkey,0)*! (E. type^KeyPress);
} void P(){ g = DefaultScreen(( A=XOpenDisplay(
0 ) ) ) ; do XAllocNamedColor
( A , DefaultColormap(
A,g),5*x+"#fff" "\0#f00\0#0f0\0"
"#000",C+x,C+4) ; while(++x^4) ;
XMapWindow(A,B= XCreateSimpleWindow
(A,RootWindow(A ,g),0,0,460,300
,0, C[3].pixel, C->pixel ) ) ;
XSelectInput(A, B,KeyPressMask| ExposureMask);D
=XCreateGC(A,B, 0,0); } void a( ){ for(y=0; y<=
e; y++)if(X)for (x=k; y%3==0&&y ^e&&x<k+t; x+=6
)XDrawRectangle (A,B,D,3+6*x,6+ 12 *y, 36, 36);
else{ move(y,k) ; H(LCORNER ) ; for(x=0; ++x^t;
)addch(x%6?y%3? 32:ACS_HLINE: y &&y-e?ACS_VLINE
: ACS_HLINE) ; H(RCORNER); } } void Q ( ) {
initscr ( ) ; start_color( );
keypad(stdscr,1 ); curs_set(0);
I(1, RED); I(2, GREEN ) ; I(3 ,
WHITE); } void d(){ for(k=!x ;
k^t; X?F(u,v,6, 12,i):mvaddch(v
,u,32|COLOR_PAIR (i))){ u=X+(1+5
*X)*(x+((i=~e?! !e*((((e-1)>>k)
&1)+1):3)>2?4:1 )*(k/2)); v=X+( 1+11*X)*(1+3*y+
k++%2); } } int S(){ mvaddstr(t ,58,b); refresh
();return getch (); } int main( int p,char**V){
((X=*++V&&**V== 88)?P:Q)(); for (srand(time(0))
; ( *Y++)--; ); for(f=++n; k^64 ; !L&&(z[p]=++k
)); L|=*z<<8; g =p&7; h = p /8; for(--l; j^113;
J(Up,UP) ? m?h? h--:1:w?w--:i:J (Down,DOWN)?m?h
^7?h++: r :w^7? w++:l: J( Left,
LEFT)?m?g?g--:3 : 7 : J (Right,
RIGHT)?m ? g^7? g++:9:s:j==10||
J(Return,ENTER) ?m?z[p=8*h+g]>>
8?m--:((((r=K(x ,x-1,l,t,3,-1,g
)+K(y,l,y-1,t,3 ,+1,g^7)+K(i,i-
1,l,1,21,-8,h)+ K(e,l,e-1,1,21,
+8,h^7))+3)&~3) ==k)?z[p]|= ++l <<8,c[w]=0, l=~
--m, s += r * ( ")%##!!!!"[--q] -33),f++:m:c[w]
?l=c[w]-!m++:n^ 64?c[w]=z[n++]& 127,q++:X:k){ p
=k=X&&!(F(0, 0, 460,300,0)); t= 48; e=24; a( );
k=t+2; t/=8; a( ); e=3; k+=8; a (); for(; p^64;
j^7?(void)j:d() ){ x=2+t*(j=p%8 ); y=p/8; e=z[p
++]>>8; d( ); x +=8; e =c[y]; } x+=8; y=0; e=l+
1; d() ; x+=m*(t*g-50)-9; y=m?h:w; t-=2; e=-1; d(); e=sprintf(b,o,s,f,(f*s)
>>6); j=(X?R:S)(); } return X||endwin(); }