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

+205
View File
@@ -0,0 +1,205 @@
#!/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=
# default flags for ANSI C compilation
#
CFLAGS= ${CWARN} ${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= endoh4
DATA= solids.tbz2
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}
${RM} -rf solids
@echo extracting solids
${TAR} -jxf ${DATA}
###############
# utility rules
###############
#
everything: all alt
clean:
${RM} -f ${ENTRY}.o ${ALT_OBJ}
clobber: clean
${RM} -f ${ENTRY} ${ALT_ENTRY}
${RM} -rf solids
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}
+8
View File
@@ -0,0 +1,8 @@
1,1,1
1,1,-1
1,-1,1
1,-1,-1
-1,1,1
-1,1,-1
-1,-1,1
-1,-1,-1
+72
View File
@@ -0,0 +1,72 @@
int
**F,**
V,M, N,i;
#ifndef/**/S
#define S 70,23
#endif/* 000-2E5*/
#define/* 2E5-2E5,2E5
*/_POSIX_C_SOURCE 199309
#include/* 2E5XXX*/<time.h>
/* 2E5-2E5X*/#include<stdio.h>
#include<stdlib.h>/* -2E5-2E5XX*/
struct timespec R={0,1E6};int j,k,m,
#define U/* -2E5X*/rand()*2./RAND_MAX-1
#define/* 2E5*/O(p,q,i)(P[p*3+i]-P[q*3+i])
/* IOCCC2013 IOCCC2013*/#define B(p,q,\
r)(O(q,p,0)*O(r,p,1)-O(q,p,1)*O(r,p, 0))
#define A(t,n)( t*)malloc( sizeof (t)*n)
#define E(p,q,r,s)B(p,q,r)*O(s ,p,2)+B(\
p,r,s)*O(q,p,2)+B(p,s,q)*O( /*XX*/r,p,2)
#define D(e,f)(c-a)?s=a, a=e,e=s,s=f,f=\
d,d=s:0;u=a+.5;m=u+1; T[01]=91;T[2]=060;
#define C (Q[u]-X) *a+(Q[u+1]-Y)*b+(Q[u\
+2]-Z)*c,g=e*c- f*b,h=f*a-d*c,f=c,c=d*b\
-e*a,d=a,a=g ,e=b,b=h,P[k]=W/2-q/s/p*3*\
W,P[k+1]= H/2+r/s/p*H/2,T[3]=0x48,*T=033
n,u,v, w,t,W,H;double*P,*Q,I,J,K,L,x,y,z
,X, Y,Z,a,b,c,d,e,f,g,h,p,q,r,s ;void o(
double x){for(p=q=i=0,s=r=1;i<99;s=(s+x
/s)/2)i%2?q+=r,r=-r:(p+=r),r*=3.14*x/++i;}
int G(int p,int q,int s,int g,int f){i\
nt* v=A(int,N),*a,*b,h=-1,r=h;for(F[f]=V
[f]=v; ++h<f;)if(V[h][p]==q){if(s+1&&E(p
,q,V[h][q ],s)<1E-4){for(a=F[g],b=F[h];N
>++r;v[r]=q+ 1?a[q]-r?q:b[p]-r?p:-1:p)p=
a[r],q=b[r];for (r=0;r<f;r++)F[r]==a||F[
r]==b?F[r]=v:0;};; return f;}for(h=0;h<N
;v[h++]=-1)r=h-p&&h-q &&(r<0||E(p,q,r,h)
<0)?h:r;v[v[v[p]=q]=r]=p ;return G(r,q,p
,f,G(p,r,q,f,G(p,q,s,g,f+1) ));}char *T;
int main(void) {H=(W=S)*2;T=A( char,(H*W
+4));for(srand(t=(int)time(0));i= scanf(
"%lf,",P=(Q=(double*)realloc(Q,(N+1) *s\
izeof(double)))+N),i>=0;)i?c+=*P**P,1<N
++%3?o(c),b=b<s?s:b,c=0:0:scanf("%*s");for
(P=A(double,N*2);j<N;)Q[j++]/=b;o(U);I=
p/1E3;J=q/1E3;K=U;L=U;N/=3;F=A(int*, 4*N
);V=F+2*N;for(;u==v;){for(j=u=m=n =0;j<3
*N;j++)P[j]=Q[j]+(U)/1E5;for(; m<N;m++)u
=P[u*3]>P[m*3]?m:u;for(v=!u ;n<N;n++)v=B
(u,v,n)>0?n:v;}for(puts( "\x1b[2J"),M=G(
u,v,-1,-1,0);;K+=I+0, L+=J){for(i=4;i<W*
H/2+3;T[++i]=j=0)T [i]=i%W-3?32:10;for(;
j<M;j++){for(n= k=0;F[j][m=n]<0;)n++;for
(;u=F[j][m]* 3,o(K=K<-1?K+2:K>1?K-2:K),c
=z=9*p,b= 9*q,o(L=L<-1?L+2:L>1?L-2:L),a=
x=b*q, y=b*=p,d=x-X,e=y-Y,f=z-Z,o(d*d+e*
e+f *f),p=C,q=C,r=C,k+=2,m=F[j][m],m-n;)
;for(p=n=0;n<k;n+=2)p+=P[n]*(P[(n+3)%k]
-P[(n+k-1)%k]);for(q=time(0)<t+3;(q||p>=0)
&&n;){a=P[n%k];b=P[n%k+1];c=P[n-=2];d=P
[n+1];e=d-b;i=e*e>(c-a)*D(b,c)0>D(c,
b)for(;c-a&&u<c+.5;0<=w&&w<W-1&&0
<=m&&m<H?v=m/2*W+w+4,T[v]="',"
";;;,;'"[T[v]%8^m%2]:0)m=v=
(d-b)*(u-a)/(c-a)+b+0.5,
w=i?m=u++,v:u++,u=u<c
&&q?c+0.5:u;}}puts
(T);nanosleep(&
R,0);X=x;Y=y
;Z=z;}}/*
IOCCC*
\*/
+150
View File
@@ -0,0 +1,150 @@
<!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 solid</title>
</head>
<body>
<h1>Most solid</h1>
<p>Yusuke Endoh<br>
<a href="&#x6d;&#97;&#105;&#x6c;&#116;&#x6f;&#x3a;&#109;&#97;&#109;&#x65;&#64;&#x72;&#x75;&#98;&#121;&#45;&#x6c;&#97;&#x6e;&#x67;&#x2e;&#x6f;&#x72;&#103;">&#x6d;&#97;&#109;&#x65;&#64;&#x72;&#117;&#98;&#x79;&#45;&#108;&#97;&#x6e;&#103;&#x2e;&#x6f;&#x72;&#x67;</a><br>
<a href="https://github.com/mame/">https://github.com/mame/</a></p>
<h2>Judges' comments:</h2>
<h3>To build:</h3>
<pre><code>make endoh4
</code></pre>
<h3>To run:</h3>
<pre><code>./endoh4
</code></pre>
<h3>Try:</h3>
<p>NOTE: The author recommends the use of xterm.</p>
<pre><code>./endoh4 &lt; cube.txt
</code></pre>
<p>For example, if you are a soccer fan, try:</p>
<pre><code>make all
./endoh4 &lt; solids/archimedian-solid/a11-truncated-icosahedron.txt
</code></pre>
<h3>Selected Judges Remarks:</h3>
<p>This program is formatted as the net for a tetrahedron. (hint, try feeding the
program it&rsquo;s own source code). When it runs there is an animation for the
computation to work out the convex hull.</p>
<h2>Author&rsquo;s comments:</h2>
<h3>Spec</h3>
<p>This is a convex polyhedron viewer, which:</p>
<ol>
<li>reads three-dimentional vertices (3N float values) from stdin,</li>
<li>calculates a convex hull of them, and</li>
<li>renders it.</li>
</ol>
<p>This simple spec involves many details.</p>
<ul>
<li>3D convex hull calculation
<ul>
<li>recursive gift wrapping algorithm</li>
<li>automatical merging of (almost) co-planar faces
(i.e., faces are not triangulated)</li>
<li>random perturbation for robustness</li>
</ul>
</li>
<li>3D rendering
<ul>
<li>perspective projection</li>
<li>ASCII line drawing: <code>"',;;;,;'"</code></li>
<li>camera in a spherical spiral orbit</li>
</ul>
</li>
</ul>
<p>(Note that this program does not use <code>math.h</code>.)</p>
<h3>Portability</h3>
<p>I think it conforms with both C89 and C99.
I confirmed that it worked on gcc, clang, and tcc.
It should not be warned with -pedantic and -Wextra.</p>
<h3>Tips</h3>
<p>You may want to use <code>tput</code> to hide a terminal cursor.</p>
<pre><code>tput civis
./endoh4 &lt; cube.txt
tput cnorm
</code></pre>
<h3>Bonuses</h3>
<p>You can change the screen size. Let the aspect ratio be about 3:1.</p>
<pre><code>gcc -DS=120,40 -o endoh4 endoh4.c
</code></pre>
<p>The shape of this code is the geometric net of a regular tetrahedron.
So, try:</p>
<pre><code>./endoh4 &lt; endoh4.c
</code></pre>
<p>The solids.tbz2 file includes various solid data:
<a href="http://en.wikipedia.org/wiki/Platonic_solid">Platonic solids</a>,
<a href="http://en.wikipedia.org/wiki/Archimedean_solid">Archimedean solids</a>,
<a href="http://en.wikipedia.org/wiki/Prism_%28geometry%29">Prisms</a>,
<a href="http://en.wikipedia.org/wiki/Antiprism">Antiprisms</a>,
<a href="http://en.wikipedia.org/wiki/Bipyramid">Bipyramids</a>,
<a href="http://en.wikipedia.org/wiki/Trapezohedron">Trapezohedrons</a>, and
<a href="http://en.wikipedia.org/wiki/Johnson_solid">Johnson solids</a>.</p>
<p>I created the files by using the POV-Ray scripts
(<a href="http://en.wikipedia.org/wiki/File:Poly.pov">1</a> and
<a href="http://en.wikipedia.org/wiki/User:AndrewKepert/poly.pov">2</a>)
in Wikipedia.
They are copyrighted in CC BY-SA 3.0
by &ldquo;User:Cyp&rdquo; and &ldquo;User:AndrewKepert&rdquo;.</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>
+105
View File
@@ -0,0 +1,105 @@
# Most solid
Yusuke Endoh
<mame@ruby-lang.org>
<https://github.com/mame/>
## Judges' comments:
### To build:
make endoh4
### To run:
./endoh4
### Try:
NOTE: The author recommends the use of xterm.
./endoh4 < cube.txt
For example, if you are a soccer fan, try:
make all
./endoh4 < solids/archimedian-solid/a11-truncated-icosahedron.txt
### Selected Judges Remarks:
This program is formatted as the net for a tetrahedron. (hint, try feeding the
program it's own source code). When it runs there is an animation for the
computation to work out the convex hull.
## Author's comments:
### Spec
This is a convex polyhedron viewer, which:
1. reads three-dimentional vertices (3N float values) from stdin,
2. calculates a convex hull of them, and
3. renders it.
This simple spec involves many details.
* 3D convex hull calculation
* recursive gift wrapping algorithm
* automatical merging of (almost) co-planar faces
(i.e., faces are not triangulated)
* random perturbation for robustness
* 3D rendering
* perspective projection
* ASCII line drawing: `"',;;;,;'"`
* camera in a spherical spiral orbit
(Note that this program does not use `math.h`.)
### Portability
I think it conforms with both C89 and C99.
I confirmed that it worked on gcc, clang, and tcc.
It should not be warned with -pedantic and -Wextra.
### Tips
You may want to use `tput` to hide a terminal cursor.
tput civis
./endoh4 < cube.txt
tput cnorm
### Bonuses
You can change the screen size. Let the aspect ratio be about 3:1.
gcc -DS=120,40 -o endoh4 endoh4.c
The shape of this code is the geometric net of a regular tetrahedron.
So, try:
./endoh4 < endoh4.c
The solids.tbz2 file includes various solid data:
[Platonic solids](http://en.wikipedia.org/wiki/Platonic_solid),
[Archimedean solids](http://en.wikipedia.org/wiki/Archimedean_solid),
[Prisms](http://en.wikipedia.org/wiki/Prism_%28geometry%29),
[Antiprisms](http://en.wikipedia.org/wiki/Antiprism),
[Bipyramids](http://en.wikipedia.org/wiki/Bipyramid),
[Trapezohedrons](http://en.wikipedia.org/wiki/Trapezohedron), and
[Johnson solids](http://en.wikipedia.org/wiki/Johnson_solid).
I created the files by using the POV-Ray scripts
([1](http://en.wikipedia.org/wiki/File:Poly.pov) and
[2](http://en.wikipedia.org/wiki/User:AndrewKepert/poly.pov))
in Wikipedia.
They are copyrighted in CC BY-SA 3.0
by "User:Cyp" and "User:AndrewKepert".
--------------------------------------------------------------------------------
<!--
(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/
-->
Binary file not shown.