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:
1 parent
28efc67f5d
commit
c0663537cb
1683 files changed
+220064
No files matched your search
@@ -0,0 +1,18 @@
|
||||
|
||||
build: boutines
|
||||
|
||||
clean:
|
||||
|
||||
clobber:
|
||||
-rm boutines
|
||||
|
||||
boutines: boutines.c
|
||||
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
|
||||
|
||||
alt: boutines.orig
|
||||
|
||||
boutines.orig: boutines.orig.c
|
||||
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
|
||||
|
||||
data:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
@@ -0,0 +1,73 @@
|
||||
#define F 0xF
|
||||
#define U 512
|
||||
|
||||
#define std(x,y) (*x)(const char *,...)=y##f
|
||||
#define str(l,e,x) l e,l x
|
||||
#define mx(p,v1,v2) p[3]=v2,p[1]=v1,p[2]=v2,*p=v1
|
||||
#define vi(n) q+2,n,q+3,n
|
||||
#define rt return
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef double n; n *d,*b,*f; typedef unsigned char c;
|
||||
char _[ ]=" <?%s version=\"1.0\"?>\n<%s %s=\"%d\" %s=\"%d\">\n", q [7][7] = {
|
||||
"ivory","black","width","height","text"};int v,std(i,scan),std(o,print);
|
||||
|
||||
int cc(str(const void*,x,y))
|
||||
{
|
||||
rt(*(n*)x>*(n*)y)-(*(n*)x<*(n*)y);
|
||||
}
|
||||
n t(n f,n g,str(n*,x,y))
|
||||
{
|
||||
f=*x++-f,g=g-*x,*y=f*f;rt *y+g*g;
|
||||
}
|
||||
c*ln(n*p)
|
||||
{
|
||||
c*f=((c*)(d+2*(2+v))+2*(p-d)); while(!*f) mx(f,rand(),rand());rt f;
|
||||
}
|
||||
n*put(str(n*,f,l),n z)
|
||||
{
|
||||
int r=(l-f)/4,p=*(f+(r*=2))<z;rt r>0?put(f+p*r,p?l:f+r,z):f;
|
||||
}
|
||||
n*g(n u,n w)
|
||||
{
|
||||
n y=u/(U-1),*s=put(d,d+v+2,y),z=w/(U-1),k,l=t(y,z,s,&k),
|
||||
m=l,*r[4],g[4],*f; c p; for(mx(r,s,0),mx(g,k,l);
|
||||
p=*(1+g)<*g,(m>*(g+1))+(*g<m);s=*f<m?m=*f,*(r+p):s)*(f=g+p+2)=t
|
||||
|
||||
(y,z,*(r+p)+=p?-2:2,p+g);rt s;
|
||||
}
|
||||
c*a(str(n*,x,r))
|
||||
{
|
||||
n*y; int i=0,j=0,k=0,u;for(u=0;y=g(*x+u/4/4.,*r+u%4/4.),16>u;++u)
|
||||
i+=*ln(y),j+=*(1+ln(y)),k+=*(ln(y)+2);
|
||||
*_=i/u,*(1+_)=j/u,*(_+2)=k/u;rt(c*)_;
|
||||
}
|
||||
|
||||
void tr(n x,n y,n i)
|
||||
{
|
||||
c*h,w;n*m=g(y,i); for(w=4*(x<2);++w<4&&m==g(w/2*x+y,i+w%2*x););
|
||||
for(w=4*(w>3&&(h=x>1?ln(m):a(&y,&i))&&o("<rect style=\"fill:rgb(%d,%d,%d\
|
||||
);\" x=\"%f\" y=\"%f\" %s=\"%f\" %s=\"%f\"/>\n",*h,*(1+h),*(2+h),str(F+,
|
||||
y,i),vi(x))),x/=2;x>0&&w<4;++w)tr(x,y+w/2*x,w%2*x+i);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
long k,r=1e6,h;d=calloc(r,k=sizeof(n)),f=d+r,b=d;
|
||||
|
||||
while(0<(h=i("%lf",b)))*--f=*b++;v=b-d;if
|
||||
|
||||
(!h+v%2+!v&&(r=0x630C65u)){o("\n0x7");while(r-->0)o("F");rt -1;}
|
||||
mx((d+v),-r,r);qsort(d,2+(v/=2),2*k,cc);
|
||||
tr(U,0&o(4+_,"xml","svg",vi(2*F+U)),0);
|
||||
|
||||
for(b=d-1+r,k=0;r=1,v>k++;b-=2)
|
||||
str(o("<%s x=\"%f\" y=\"%f\" fill=\"%s\" %s-anchor=\"end\">%d</%s>\n",
|
||||
4+q,str(F+r/2.-5+U**,b,(b-1)),q+r,q+4,k+!o
|
||||
("<circle style=\"fill:%s;\" cx=\"%f\" cy=\"%f\" r=\"3\"/>\n",
|
||||
r+q,str(F+r/4.+U**,b,(b-1))),4+q),&&r--,);
|
||||
|
||||
free(d);rt o("</svg>\n")-7;
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
|
||||
#define F 0xF
|
||||
#define U 512
|
||||
|
||||
#define std(x,y) (*x)(const char *,...)=y##f
|
||||
#define str(l,e,x) l##e,l##x
|
||||
#define mx(p,v1,v2) p[3]=v2,p[1]=v1,p[2]=v2,*p=v1
|
||||
#define mov(x,y) y=*f<m?x:y
|
||||
#define vi(n) q+2,n,q+3,n
|
||||
#define rt return
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef float n; n *d,*b,*f; typedef unsigned char c;
|
||||
char _[ ]=" <?%s version=\"1.0\"?>\n<%s %s=\"%d\" %s=\"%d\">\n", q [7][7] = {
|
||||
"ivory\0","black\0","width\0","height\0","text"};int v,std(i,scan),std(o,print);
|
||||
|
||||
int cc(str(const void*,x,y))
|
||||
{
|
||||
rt(*(n*)x>*(n*)y)-(*(n*)x<*(n*)y);
|
||||
}
|
||||
n t(n f,n g,str(n*,x,y))
|
||||
{
|
||||
f=*x++-f,g=g-*x,*y=f*f;rt *y+g*g;
|
||||
}
|
||||
c*ln(n*p)
|
||||
{
|
||||
c*f=((c*)(d+2*(2+v))+2*(p-d)); while(!*f) mx(f,rand(),rand());rt f;
|
||||
}
|
||||
n*put(str(n*,f,l),n z)
|
||||
{
|
||||
int r=(l-f)/4,p=*(f+(r*=2))<z;rt r>0?put(f+p*r,p?l:f+r,z):f;
|
||||
}
|
||||
n*g(n u,n w)
|
||||
{
|
||||
n y=(.5+u)/U, *s=put(d,d+v+2,y),z=(w+.5)/U,k,l=t(y,z,s,&k),
|
||||
m=l,*r[4],g[4],*f; c p; for(mx(r,s,0),mx(g,k,l);
|
||||
p=*(1+g)<*g,(m>*(g+1))+(*g<m);mov(*(r+p),s),mov(*f,m))*(f=g+p+2)=t
|
||||
(y,z,*(r+p)+=p?-2:2,p+g);rt s;
|
||||
}
|
||||
c*a(str(n*,x,r))
|
||||
{
|
||||
n*y; int i=0,j=0,k=0,u;for(u=0;y=g(*x+u/4/4.,*r+u%4/4.),16>u;++u)
|
||||
i+=*ln(y),j+=*(1+ln(y)),k+=*(ln(y)+2);
|
||||
*_=i/u,*(1+_)=j/u,*(_+2)=k/u;rt(c*)_;
|
||||
}
|
||||
|
||||
void tr(n x,n y,n i)
|
||||
{
|
||||
c*h,w;n*m=g(y,i); for(w=4*(x<=1);++w<4&&m==g(w/2*x+y,i+w%2*x););
|
||||
w=4*(w>=4&&(h=x>1?ln(m):a(&y,&i))&&o
|
||||
("<rect style=\"fill:rgb(%d,%d,%d);\" x=\"%f\" y=\"%f\" %s=\
|
||||
\"%f\" %s=\"%f\"/>\n",*h,*(1+h),*(2+h),str(F+,y,i),vi(x)));
|
||||
for(x/=2;x>0&&w<4;++w)tr(x,y+w/2*x,w%2*x+i);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
long k,r=1e6,h;d=calloc(r,k=sizeof(n)),f=d+r,b=d;
|
||||
|
||||
while(0<(h=i("%f",b)))*--f=*b++;v=b-d;if
|
||||
|
||||
(!h+v%2+!v&&(r=0x630C65u)){o("\n0x7");while(r-->0)o("F");rt -1;}
|
||||
mx((d+v),-r,r);qsort(d,2+(v/=2),2*k,cc);
|
||||
tr(U,str(0,*o(4+_,"xml","svg",vi(2*F+U)),0));
|
||||
|
||||
for(b=d-1+r,k=0;v>k++;b-=2)for(r=1;0<=r;--r)
|
||||
o("<%s x=\"%f\" y=\"%f\" fill=\"%s\" %s-anchor=\"end\">%d</%s>\n",
|
||||
4+q,str(F+r/2.-5+U**,b,(b-1)),q+r,q+4,k+!o
|
||||
("<circle style=\"fill:%s;\" cx=\"%f\" cy=\"%f\" r=\"3\"/>\n",
|
||||
r+q,str(F+r/4.+U**,b,(b-1))),4+q);
|
||||
|
||||
free(d);rt o("</svg>\n")-7;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,130 @@
|
||||
# Most superfluous output
|
||||
|
||||
Francois Boutines
|
||||
Toulouse, France
|
||||
francois.boutines@gmail.com
|
||||
|
||||
## Judges' Comments
|
||||
|
||||
### To build
|
||||
|
||||
cc -o boutines boutines.c
|
||||
|
||||
### To run
|
||||
|
||||
You will need an [SVG] viewer. Look here to find some [SVG Viewer Implementations].
|
||||
|
||||
[SVG]: http://www.w3.org/Graphics/SVG/
|
||||
[SVG Viewer Implementations]: http://wiki.svg.org/Viewer_Implementations
|
||||
|
||||
The following will create an SVG file,
|
||||
|
||||
perl -e 'map{print rand," ",rand,"n";}(1..20);' | ./boutines > test.svg
|
||||
|
||||
Can you explain the author's remark "[generated files] are not as scalable as their name suggests"?
|
||||
|
||||
## Author's Comments
|
||||
|
||||
_In memory of my father Pierre Boutines-Vignard._
|
||||
|
||||
### Walkthrough
|
||||
|
||||
My program works as follows:
|
||||
|
||||
**Input**
|
||||
> a list of 2D points in the unit square
|
||||
|
||||
**Output**
|
||||
> a Voronoi diagram of the set as an [SVG] stream
|
||||
|
||||
This will possibly save a compressed SVG file and may be useful:
|
||||
|
||||
./boutines | gzip > result.svgz
|
||||
|
||||
Input consists of a list of floating points values separated by whitespaces
|
||||
(ranging preferably in [0,1]). Alternating an horizontal coordinate, a
|
||||
whitespace then the other coordinate (pointing downwards in the resulting
|
||||
graph) and a newline will just go fine :
|
||||
|
||||
0 0
|
||||
0 1
|
||||
1 0
|
||||
1 1
|
||||
.5 .5
|
||||
|
||||
Strictly speaking, you have to provide a **set** of points. If there are
|
||||
duplicates in the list, there is no guarantee on the one to be shown (in
|
||||
addition their labels will overlap) in the resulting colored Voronoi diagram.
|
||||
|
||||
### Caution
|
||||
|
||||
This program might have been a lot shorter, but nearly impractical even for
|
||||
medium sized datasets. On the other hand it could have been a lot faster, but
|
||||
hard to qualify under the IOCCC size limit. So guess what I did a compromise
|
||||
favoring innermost obfuscation, sacrificing sometimes speed and other tedious
|
||||
factors.
|
||||
|
||||
Therefore this entry is limited to
|
||||
|
||||
> 
|
||||
|
||||
points and won't even be suitable for more than a few thousand : although
|
||||
generated files do pass [W3C SVG Validator], and are highly compressible,
|
||||
they are not as scalable as their name suggests… For serious applications
|
||||
about Voronoi diagrams, see [Qhull], [CGAL] and the like : but you may
|
||||
still encounter large output volumes (and have to handle some sort of clipping
|
||||
in order to represent properly infinite regions of the diagram in SVG).
|
||||
|
||||
[W3C SVG Validator]: http://jiggles.w3.org/svgvalidator/
|
||||
[Qhull]: http://www.qhull.org/
|
||||
[CGAL]: http://www.cgal.org/
|
||||
|
||||
Beware, compilation may report warnings about precision loss, linting may be a
|
||||
disaster, but the code should remain portable, and the output accurate enough
|
||||
for most devices (including many inkjet printers). If you ever miss precision
|
||||
on a particular dataset or peripheral, you may want to dive in and let U be
|
||||
the next power of `__LINE__`.
|
||||
|
||||
Note : bad inputs will be sanctioned by the production of the 42nd Mersenne
|
||||
prime (ie. 2^25964951 -1), memory will be kept.
|
||||
|
||||
### Why I think this code is Obfuscated ?
|
||||
|
||||
I'm quite divided on the subject because I wrote :
|
||||
|
||||
* clear SVG key words but complicated output statements
|
||||
* no nested loops but loads of function calls
|
||||
* easy recursion but no clear data struture
|
||||
* easy maths but no use of math.h
|
||||
* a single if
|
||||
|
||||
Be sure to check the antepenultimate line of code.
|
||||
|
||||
### Missing Features
|
||||
|
||||
**Color control**
|
||||
> Cell colors are chosen randomly (with a questionable rejection scheme). It
|
||||
might have been useful to input them along with sites coordinates, turning the
|
||||
application into a puzzling graphics engine.
|
||||
|
||||
**Site labelling**
|
||||
> The points are implicitly numbered in the order they were entered
|
||||
(starting at one). This can be overridden however, via a simple XSL
|
||||
transformation.
|
||||
|
||||
**Site radius**
|
||||
> The site radius is hardwired in the code, I still wonder why I did not
|
||||
design it as a function of the underlying cell's area (which can be averaged
|
||||
for free) or at least a command line parameter. Same with the char set, the
|
||||
viewport and potentially every SVG property.
|
||||
|
||||
## See Also
|
||||
|
||||
[Voronoi at Wikipedia](http://en.wikipedia.org/wiki/Voronoi_diagram),
|
||||
[An Excerpt from The Algorithm Design Manual](http://www2.toki.or.id/book/AlgDesignManual/BOOK/BOOK4/NODE187.HTM),
|
||||
[Voronoi and Art](http://www.snibbe.com/scott/bf)
|
||||
|
||||
## Example Output
|
||||
|
||||
> 
|
||||
|
||||
Reference in new issue
Block a user