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 @@
LDFLAGS+=-lm
build: persano
clean:
clobber:
-rm persano
persano: persano.c
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
alt:
data:
+116
View File
@@ -0,0 +1,116 @@
# Best of show
Mauro Persano
São Paulo
Brazil
mauro_persano@yahoo.com
## Judges' Comments
### To build
cc -lm persano.c -o persano
If your system is one of those that distinguish between text and binary
streams, you must know what to do to switch the standard output into
binary mode (e.g. adding a line to the source code or specifying a
linker option).
### Try
persano 3 16 > knot3-16.gif
Open the GIF file with a viewer capable of displaying animated GIFs and
watch closely at the bottom of the picture (you may need to use
"gifsicle" - a great tool to manipulate animated GIFs - to slow down the
animation and to compress the GIFs generated by the entry).
What needs to be done to fix the problem?
Solving the author's exercises below may or may not help.
At the time of judging, the approximation of π used in the program could
not be found on mathworld.com.
## Selected Author's Comments
### NAME
**knot**
> writes animated GIF images of rendered torus knots to standard output.
### SYNOPSIS
knot p q [num frames]
### DESCRIPTION
A (p,q)-torus knot is a closed, non-intersecting curve on the surface of
a torus in R3 that winds p times around one cycle of the torus and q
times around the other. p and q should be coprime; otherwise, the
resulting curve will _not_ be a knot (that is, imagining the resulting
curve as a loop of rubber, there will be a way to bend, twist and
stretch it, without cutting it [1], until it ends up looking just like a
circle embedded in R3 [2]).
Sample usage:
knot 3 2 1 > foo.gif
writes a non-animated GIF (a single frame) stream of a rendered trefoil
knot to the file foo.gif.
knot 5 2
writes a GIF stream with a rendering of Solomon's Seal knot to standard
output; since the number of frames is not specified, an animation with
40 frames will be written.
Please view the code with 8-character tabs!
### OUTPUT FORMAT
The program writes fully valid GIF 89 streams.
It is suggested that the output be viewed with a program capable of
displaying animated GIFs, such as almost any graphical HTTP browser.
Due to code size constraints, full LZW compression was not implemented
[3]. In fact, the output images are even somewhat expanded, thanks to
GIF overhead.
The GIF format supports only a limited number of bits per pixel, so the
program uses ordered dithering to emulate full RGB output.
### PORTABILITY
The program was tested on Linux, with gcc 3.1; Cygwin, with gcc 3.3; and
Solaris/Sparc, with Sun's C compiler.
The only major portability issue should be reliance on ASCII.
It should also be mentioned that the program won't work on systems that
distinguish between text and binary streams; however, since hardly
anyone uses such systems in this day and age, this is a minor issue. [4]
### EXERCISES FOR THE READER
1. (1 point) The surface is composed of many small polygons. Try to make it
smoother by increasing the number of polygons.
2. (2 points) Figure out how to change the radius of the tube cross section.
3. (5 points) Locate the famous transcendental constant π in the code.
### FOOTNOTES
[1] You can call such a transformation an "ambient isotopy" if you want to
impress people at parties.
[2] Also known as the "unknot", which sounds slightly less impressive than
"ambient isotopy".
[3] Unfortunately (for the author), the convenient excuse that LZW compression
was not implemented in order to avoid the Unisys patent can no longer be used.
[4] ;)
+138
View File
@@ -0,0 +1,138 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define H 20
#define X for
#define F(v,b) X(k = 0; k < 3; k++) v[k] = b;
typedef double R, V[3], U[4], (*J)(R);
typedef void Z;
typedef int _;
V o, d, v;
R (*q)[H][6], C[4*H][H][6], sr = 15, br = 25, A, s, t;
_ P, Q, g, S, k, e = 256, (*u)(_) = putchar, D[64];
J f = cos, Y = sin;
char B[256];
Z
T(_ *p, _ k, _ n)
{
_ g;
*p = n;
X(g = 0; k && g < 4; g++)
T(p + (9 & (g * 4|g))*(1<<k - 1), k - 1,
n + (1<<6-2 * k)*(4 - g&3));
}
Z
O(_ c)
{
B[++S] = c,
(S > e-2 || c==129) && (*B = S, S = fwrite(B, S+1, 1, stdout) - 1);
}
Z N
(R*v){R w=sqrt
(*v**v +1[v]*v[1]
+v[2]*2[v]);F(v,v[k]
/w)}Z K(_ j){V
n,p ;R*b=(*
q) [j],w=f
(A),x=
Y(A);
F(p,
br*o[
k]+sr
* (n[ k] =f(t)*k[v]+
Y(t)*(v[(k+1)%3]* d[( k+2)%3]-v[(k+2)%
3]*d[(k+1)%3])))*b++=p[1 ]+e/ 2,*b++=-*p*x+
p[2]*w-e*e,*b++=(*p*w+p[2]*x)+e/2;F( b,fabs(*n
*!!k+n[1]*( k<2)+n[2])/sqrt(2+ !(k-1)))
}Z M(R*a,_ s,Z(*m)(_)){_ i;R d=
pow(25/log (36),4)/s/ 377;X(
*a=i=0;i<s ;i++,*a+=d )m(i);
}Z G(_ i ){R w=-Y (P*s),
x=f(P*s), y=Y(Q*s ),z=f
(Q*s);F( v,k[o] =(k<2
)*(x+3)*( k?y:z) -!(k-2 )*w)N(
v);F(d,P* (k?k- 1?x:w*y:w*z )+Q*(k?
k-1?0:*o:- o[1]) )N(d),w=*d**v+d[1]
*v[1]+d[2] *v[2 ];F(v,k[v]-w
*d[k])N(v),q =&C[
i],M(&t,H,K); }Z W
(char*s){*s&&( W(s
+1),u(*s-98*(*s>
97)));}Z E(_ z){R
*r,*a,*b;U*q,l,x,d
,I[256];_ i,j,m,c,y,
w,h,Y=sizeof l;fputc(
46,stderr),M(&s,4*H,G),
W("ibcbcbbbbb,"),g=130,
O(e/2);X(y=0;y<e;y++){X(i
=e;i;)*(I[--i])=0;X(;i<4
*H*H;i++)X(*l=k=0;k-5;k++
,a=b)if(b=C[(i/H+((k^k/
2)&1))%(4*H)][(i+(k/2&1
))%H],k&&y<*a^y<*b){X(
h=0;h<4;h++)h[x]=a[h
+2]+(b[h+2]-a[h+2])
*(y-*a)/(*b-*a),h?
*l&&(d[h]=(l[h]
-h [x])/w):(w=1+
fabs (*l-(*x=(_)*x)
) ); X(q=I+(_)*x;
*l&& w--;q+=2*(
*x<* l)-1)X(**q
>C[i /H][i%H][1
]&&( memcpy(*q,
x,Y),* *q=C[i/H][
i%H][1 ]),h=1;h<
4;h++)x [h]+=h[d];
memcpy(l ,x,Y);}X(
i=0;i<e;i++ ,O(*r?c:
127),g=g<e-1 ?g+1:(O(e/
2),130))X(r=&I[ i][3],c=0,j
=2;j+1;j--,r--)k=3|!( j-1)*4,m=*r*k+
(63*( *r*k-(_)(*r*k))>D[(y*8&56)+(i&7)
]), c<<=k/4+2,c|=(m|-(m>k))&
k;} O(129);u(0);}_
main(_ c, char **v)
{
if (c < 3)
return fprintf(stderr, "Usage: %s P Q [F]\n", *v), 1;
P = atoi(v[1]),
Q = atoi(v[2]),
T(D, 3, 0);
W("bb\346cbcba98FIG");
X(; k < 384; k++)
u(k / 3<<("gdb"[k%3] - 97) | 31 | (k % 3!=1)<<5);
W("bbbce0.2EPACSTEN\x0b\xff!"),
M(&A, c > 3 ? atoi(v[3]) : 40, E),
u(59);
return 0;
}
/* vi:set ts=8: */