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

+202
View File
@@ -0,0 +1,202 @@
#!/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
#CWARN= -Wall -pedantic
# 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= -lm
# default flags for ANSI C compilation
#
CFLAGS= ${CWARN} -ffast-math ${CSTD} ${ARCH} ${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= mills
DATA=
ALT_OBJ=
ALT_ENTRY=
#################
# build the entry
#################
#
all: ${ENTRY} ${DATA}
@${TRUE}
${ENTRY}: ${ENTRY}.c
${CC} ${CFLAGS} -DLT=0,-9,70,130,50,30,-60,40,30 -DNL=9 -DEY=0,-22,37 -Dwin_port="sin_addr.s_addr=htonl(2130706433),R.sin_port" $< -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}
+160
View File
@@ -0,0 +1,160 @@
<!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 timely rendered</title>
</head>
<body>
<h1>Most timely rendered</h1>
<p>Christopher Mills<br>
<a href="&#x6d;&#97;&#105;&#x6c;&#116;&#x6f;&#x3a;&#109;&#114;&#120;&#x6f;&#64;&#x73;&#x6f;&#110;&#105;&#99;&#x2e;&#110;&#x65;&#x74;">&#x6d;&#x72;&#x78;&#111;&#x40;&#115;&#111;&#x6e;&#105;&#x63;&#46;&#110;&#x65;&#116;</a></p>
<h2>Judges' comments:</h2>
<h3>To build:</h3>
<pre><code>make mills
</code></pre>
<h3>To run:</h3>
<pre><code>./mills
</code></pre>
<h3>Try:</h3>
<pre><code>./mills &amp;
</code></pre>
<p>While that is running, point your favorite browser at: <a href="http://localhost:8224">http://localhost:8224</a></p>
<h3>Selected Judges Remarks:</h3>
<p>Who will be the first to post an image rendered during a leap-second?</p>
<h2>Author&rsquo;s comments:</h2>
<h1>The Program</h1>
<p>This program is a handy graphical clock. Simply run the program, click <em>OK</em> to
any annoying security dialogs that pop up (aren&rsquo;t those annoying?), then fire
up your web browser and type in the following URL:</p>
<blockquote><p> <a href="http://localhost:8224">http://localhost:8224</a></p></blockquote>
<p>You will soon be presented with a lovely dynamically rendered 3D scene that
also convienently tells you the current time!</p>
<h2>Usage Notes</h2>
<p>The program will continue to give you the time of day as it changes by
reloading the page as often as it can render. If you grow tired of watching
your life slip by, hit <code>Control-C</code> in the original window. Note that if you
want to restart the program again, you should wait a minute or two before
doing so. For details as to why this is necessary, feel free to Google
<code>TIME_WAIT</code>. And while you are there, click on an ad. They could use the
money.</p>
<p>It would be possible to fix this by adding</p>
<pre><code>n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&amp;n,sizeof n),
</code></pre>
<p>at an appropriate spot in the code (an exercise left to the reader). However,
as this limitation is documented, it is not techinally a bug.</p>
<h2>Details of Operation</h2>
<p>The program wears many hats (not literally). It is</p>
<ul>
<li>a web server</li>
<li>a PNG encoder</li>
<li>a ray tracer</li>
<li>a clock</li>
</ul>
<p>It replies to web requests with a PNG image that uses the
<a href="http://en.wikipedia.org/wiki/Adam7_algorithm">Adam7</a>
encoding to return data progressively. Since the data is returned in Adam7
format, the scene is displayed initally at a lower resolution and allowed to
be progressively refined as time goes on. The ray tracer is integrally tied
to the PNG encoder, casting rays in the Adam7 order. The web server uses
PNG primarily because of PNG&rsquo;s ability to return data progressively, and not
as you might think because the PNG standard is so obfuscated as to require
both little- and big-endian encodings at different spec layers.</p>
<p>Since ray-tracing was an obvious choice to return to a web server, I needed
something to ray-trace. A static scene would be uninteresting. I took
inspiration (as I often do) from the IOCCC remarks file which says</p>
<blockquote><p> At least one judge prefers to maintain the use of the leap-second
as part of the world&rsquo;s time standard.</p></blockquote>
<p>Then it was obvious; The code should display the time. It is believed (but
not confirmed) that the code will, in fact, display leap seconds correctly.</p>
<p>To display the time, of course we would need a font. This font is encoded
as a string, using only the C whitespace characters. Clearly, the judges
intended this use of whitespace for data compression, since their tool
doesn&rsquo;t count whitepsace in strings differently than whitespace outside of
them.</p>
<h2>User-modifyable Features</h2>
<p>The code can be user-modified simply by changing the build command line.
The following symbols are defined in the build file:</p>
<ul>
<li><p><code>-DLT=x1,y1,z1,x2,y2,z2,...</code></p>
<p>Defines the coordinates of the lights in the scene. It should be a
comma-separated list of coordinates (x, y, z), three per light.</p></li>
<li><p><code>-DNL=n</code></p>
<p>Defines the number of lights. Should be equal to the length of the list
above (three times the number of lights).</p></li>
<li><p><code>-DEY=x,y,z</code></p>
<p>Defines the position of the viewer (the eyepoint) for the scene. The eye
is looking at the origin (0, 0, 0).</p></li>
</ul>
<h2>Other Build Flags</h2>
<p>The original program bound the server to <code>INADDR_ANY</code> to allow everyone to
experience the server&rsquo;s output. The Judges suggested that I instead restrict
the bind to <code>INADDR_LOOPBACK</code> to reduce security alarms. As a compliant veteran
of innumerable post-ship late feature additions, I have modified the <code>Makefile</code>
to inject the new code without destroying the beautiful spherical symmetry of
the source code. In addition, I have altered the word <code>sin_port</code> to the more
family-friendly version <code>win_port</code> to protect against curious impressionable
youth trying to learn about sockets on Internet.</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>
+135
View File
@@ -0,0 +1,135 @@
# Most timely rendered
Christopher Mills
<mrxo@sonic.net>
## Judges' comments:
### To build:
make mills
### To run:
./mills
### Try:
./mills &
While that is running, point your favorite browser at: [http://localhost:8224](http://localhost:8224)
### Selected Judges Remarks:
Who will be the first to post an image rendered during a leap-second?
## Author's comments:
The Program
===========
This program is a handy graphical clock. Simply run the program, click *OK* to
any annoying security dialogs that pop up (aren't those annoying?), then fire
up your web browser and type in the following URL:
> <http://localhost:8224>
You will soon be presented with a lovely dynamically rendered 3D scene that
also convienently tells you the current time!
Usage Notes
-----------
The program will continue to give you the time of day as it changes by
reloading the page as often as it can render. If you grow tired of watching
your life slip by, hit `Control-C` in the original window. Note that if you
want to restart the program again, you should wait a minute or two before
doing so. For details as to why this is necessary, feel free to Google
`TIME_WAIT`. And while you are there, click on an ad. They could use the
money.
It would be possible to fix this by adding
n=1,setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&n,sizeof n),
at an appropriate spot in the code (an exercise left to the reader). However,
as this limitation is documented, it is not techinally a bug.
Details of Operation
--------------------
The program wears many hats (not literally). It is
- a web server
- a PNG encoder
- a ray tracer
- a clock
It replies to web requests with a PNG image that uses the
[Adam7](http://en.wikipedia.org/wiki/Adam7_algorithm)
encoding to return data progressively. Since the data is returned in Adam7
format, the scene is displayed initally at a lower resolution and allowed to
be progressively refined as time goes on. The ray tracer is integrally tied
to the PNG encoder, casting rays in the Adam7 order. The web server uses
PNG primarily because of PNG's ability to return data progressively, and not
as you might think because the PNG standard is so obfuscated as to require
both little- and big-endian encodings at different spec layers.
Since ray-tracing was an obvious choice to return to a web server, I needed
something to ray-trace. A static scene would be uninteresting. I took
inspiration (as I often do) from the IOCCC remarks file which says
> At least one judge prefers to maintain the use of the leap-second
> as part of the world's time standard.
Then it was obvious; The code should display the time. It is believed (but
not confirmed) that the code will, in fact, display leap seconds correctly.
To display the time, of course we would need a font. This font is encoded
as a string, using only the C whitespace characters. Clearly, the judges
intended this use of whitespace for data compression, since their tool
doesn't count whitepsace in strings differently than whitespace outside of
them.
User-modifyable Features
------------------------
The code can be user-modified simply by changing the build command line.
The following symbols are defined in the build file:
* `-DLT=x1,y1,z1,x2,y2,z2,...`
Defines the coordinates of the lights in the scene. It should be a
comma-separated list of coordinates (x, y, z), three per light.
* `-DNL=n`
Defines the number of lights. Should be equal to the length of the list
above (three times the number of lights).
* `-DEY=x,y,z`
Defines the position of the viewer (the eyepoint) for the scene. The eye
is looking at the origin (0, 0, 0).
Other Build Flags
-----------------
The original program bound the server to `INADDR_ANY` to allow everyone to
experience the server's output. The Judges suggested that I instead restrict
the bind to `INADDR_LOOPBACK` to reduce security alarms. As a compliant veteran
of innumerable post-ship late feature additions, I have modified the `Makefile`
to inject the new code without destroying the beautiful spherical symmetry of
the source code. In addition, I have altered the word `sin_port` to the more
family-friendly version `win_port` to protect against curious impressionable
youth trying to learn about sockets on Internet.
--------------------------------------------------------------------------------
<!--
(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/
-->
+43
View File
@@ -0,0 +1,43 @@
#include <math.h>
#include <time.h>
#include <unistd.h>
#include <netinet/in.h>
typedef float F,A[3]; F D,M
[999]={ LT} ,*L=NL+M,*P,b,t,*h,*i; A
#define S(x,y,z)F x(F*d,F z s){ F t=y; t+=y; return t+=y; }
E,Q,U,V,C,c,I={ EY} ; unsigned char g[2414],*p=g,*e; int j,k,s,m
,n,x,y; S(B,*d++=*s++,*)S(o,*d+++=*s++,*)S(a,*d++-=*s++,*)S(H,*d++
**s++,*)S(X,*d++*=s,)S(v,*d+++=s,)int w(int c){ return*p++=c; } F W(F*
d){ return sqrt(H(d,d)); } void r(uint32_t u){ w(u>>24); w(u>>16); w(u>>
8); w(u); } F O(F*d){ return X(d,1/W(d)); } char*z,*f; void u(char*s){ *
s&&w((u(1+s),*s)); } F G(F x,int p){ for(z=p*46+f; 12^*z; x+=.5){ for(D=-4;
5>D; D++)if(9-*z++){ *P++=x; *P++=D/2; *P++=0; } } return p; } void K(){ write
(k,g,p-g); p=g; } F*d(){ h=0; D=1e9; a(E,Q); O(E); 2[E]&&0>(t=(1+2[Q])/2[E])&&
(D=-t,h=P); for(i=M; P>i; i+=3){ B(C,i); a(C,Q); b=H(E,C); (t=b*b-H(C,C)+(i<L?99
:.6))>=0&&0<(t=b<t?t+b:b-t)&&D>t&&(D=t,h=i); } return h; } void Y(int N){ F*h,*i
; A p,n; if(!(h=d()))*c=1[c]=(2[c]=2[E]/2)/2; else if(h<L){ X(c,0); v(c,1); } else
{ B(p,E); X(p,D); o(p,Q); if(h-P){ B(n,p); a(n,h); O(n); } else{ X(n,0); ++2[n]; }
B(Q,n); X(Q,1e-4); o(p,Q); X(c,0); if(N<8){ B(Q,n); X(Q,2*H(n,E)); a(E,Q); o(E,p);
B(Q,p); Y(1+N); X(c,h-P?.8:.2); } for(i=M; L>i; ++i){ B(E,i); B(Q,p); d()-i||v(c,(
h-P?.1:.5)*H(n,E)); } v(c,0.05); h-P||(2[c]*=.3,c[1&lrint(*p)^lrint(1[p])&1]*=.2);
} } void Z(char*s){ K(); p+=4; u(s?s:"TADI"); } void J(){ uint32_t c=~0; e=p; p=g;
r(e-p-8); while(p!=e){ c^=*p++; for(j=0; 8>j; j++)c=c/2^c%2*3988292384; } r(~c); K
(); } void q(int c){ w(c); m+=c; m%=c=65521; n+=m; n%=c; } void T(F c){ c=.5+255
*c; q(0>c?0:c>255?255:c); } struct sockaddr_in R; int main(){ time_t i; struct
tm*b; R.win_port=8224; s=socket(R.sin_family=AF_INET,SOCK_STREAM,0); bind(s,
(void*)&R, sizeof R); listen(s,1); for(; ; ){ k=accept(s,0,0); for(; ; ){ ++j;
read(k,p,1); if(*p=='\n') { if(3>j)break; j=0; } } m=1; u("\n\032\n\rGNP"
"\211\n\r\n\r1 :hserfeR\n\rKO 002 0.1/PTTH"); Z("RDHI"); r(800); r(600); w
(8); r(33554433); J(); Z(0); w(120); w(1); J(); i=time(0); b=localtime(&
i); x=b->tm_sec; *I=45<x?x-60:15>x?x:30-x; *U=-I[1]; 1[U]=*I; *V=2[I]*
*I; 1[V]=2[I]*1[I];2[V]=-*I**I-1[I]*1[I]; O(U); O(V); X(U,D=W(I)/
1e3); X(V,D); P=L;y=1+(11+b->tm_hour)%12; 9<y&&G(-14,y/10); G(-
10,y%10); G(-6,10); y=b->tm_min; G(-2,y/10);G(2,y%10); G(6,
10); G(10,x/10); G(14,x%10); for(z="xxxdtrb! d r y "; 9[z]; ++z){
for(y=7&8[z]; 600>y; y+=14&*z){ Z(0); w(0); p+=4; q( 0); for(x=7&9[z]; 800>x;
x+=15&1[z]){ B(Q,V); X(Q,y-300); B(E,U); X(E,x -400); o(E,Q); B(Q,I); Y(0);
T(*c); T(1[c]); T(2[c]); } j=p-g-13; 12[ g]=~(10[g]=j>>8); 11[g]=~(9[g]=
j); J(); } } Z(0); w(1); r( 65535); r(n<<16|m); n=0; J(); Z(
"DNEI"); J(); j=0; close(k); } } char*f=
" ";