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

+287
View File
@@ -0,0 +1,287 @@
#!/usr/bin/env make
#
# 2018 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
BUNZIP2= bunzip2
GZIP_PROG= gzip
BZIP2= bzip2
CURL= curl
DD= dd
LD= ld
MAKE= make
RM= rm
SED= sed
TAR= tar
TRUE= true
MKDIR= mkdir
MV= mv
TR= tr
GREP= grep
SORT= sort
UNIQ= uniq
STRIP= strip
# Set X11_LIBDIR to the directory where the X11 library resides
#
#X11_LIBDIR= /usr/X11R6/lib
#X11_LIBDIR= /usr/X11/lib
X11_LIBDIR= /opt/X11/lib
# Set X11_INCLUDEDIR to the directory where the X11 include files reside
#
#X11_INCDIR= /usr/X11R6/include
#X11_INCDIR= /usr/X11/include
X11_INCDIR= /opt/X11/include
# Compiler warnings
#
#CWARN=
#CWARN= -Wall
#CWARN= -Wall -Wextra
CWARN= -Wall -Wextra -pedantic ${CSILENCE}
#CWARN= -Wall -Wextra -Weverything
#CWARN= -Wall -Wextra -Weverything -pedantic
#CWARN= -Wall -Wextra -Weverything -pedantic ${CSILENCE}
# Silence warnings that ${CWARN} would normally complain about
#
CSILENCE=
#CSILENCE= -Wno-implicit-int
# compiler standard
#
#CSTD=
#CSTD= -ansi
CSTD= -std=c11
# compiler bit architecture
#
# Some entries require 32-bitness:
# ARCH= -m32
#
# Some entries require 64-bitness:
# ARCH= -m64
#
# By default we assume nothing:
#
ARCH=
# defines that are needed to compile
#
CDEFINE= -D_DEFAULT_SOURCE
#CDEFINE= -DIOCCC=25
# include files that are needed to compile
#
CINCLUDE=
#CINCLUDE= -include stdlib.h
#CINCLUDE= -include stdio.h
#CINCLUDE= -include stdlib.h -include stdio.h
#CINCLUDE= -I ${X11_INCDIR}
# 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.
# Reasonable compilers will allow for -O3.
#
#OPT=
#OPT= -O
#OPT= -O1
#OPT= -O2
OPT= -O3
# default flags for ANSI C compilation
#
CFLAGS= ${CSTD} ${CWARN} ${ARCH} ${CDEFINE} ${CINCLUDE} ${OPT}
# Libraries needed to build
#
LIBS= -lm
#LIBS= -L ${X11_LIBDIR}
# 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
##############################
#
OBJ= prog.o
DATA=
TARGET= prog
#
ALT_OBJ=
ALT_TARGET= prog.orig
#################
# build the entry
#################
#
all: ${TARGET} ${DATA}
@${TRUE}
prog: prog.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# alternative executable
#
alt: ${ALT_TARGET}
@${TRUE}
prog.orig: prog.orig.c
${CC} ${CFLAGS} $< -o $@ ${LIBS}
# data files
#
data: ${DATA}
@${TRUE}
###############
# utility rules
###############
#
everything: all alt
clean:
${RM} -f ${OBJ} ${ALT_OBJ}
clobber: clean
${RM} -f ${TARGET} ${ALT_TARGET}
@-if [ -e sandwich ]; then \
${RM} -f sandwich; \
echo 'ate sandwich'; \
fi
nuke: clobber
@${TRUE}
dist_clean: nuke
@${TRUE}
install:
@echo "Surely you are performing, Dr. May!"
@${TRUE}
# backwards compatibility
#
build: all
@${TRUE}
##################
# 133t hacker rulz
##################
#
love:
@echo 'not war?'
@${TRUE}
haste:
$(MAKE) waste
@${TRUE}
waste:
@echo 'haste'
@${TRUE}
make:
@echo 'Attend a maker faire'
@${TRUE}
easter_egg:
@echo you expected to often mis-understand this $${RANDOM} magic
@echo chongo '<was here>' "/\\oo/\\"
@echo Eggy
fabricate fashion form frame manufacture produce: make
@${TRUE}
sandwich:
@if [ `id -u` -eq 0 ]; then \
echo 'Okay.'; \
echo $${RANDOM}`date +%s`$${RANDOM} > $@; \
else \
echo 'What? Make it yourself.'; \
exit 1; \
fi
# 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_v6; \
else \
echo "planet deniers, like some members of the IAU, are so cute when they try to defend their logic"; \
fi
@echo A $@ helps ${MAKE} the elements that help form planets
@${TRUE}
deep_magic:
@-if [ -r .code_anal ]; then \
ccode_analysis --deep_magic 3a3fabb90892eeb2f610ae0f74a35a970060665a063ab702bd686c17c4ae07f6 --FNV1a_hash_256_bit "prog"; \
else \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
sleep 2; \
echo "Wrong! Do it again!"; \
fi
@${TRUE}
magic: deep_magic
@-if [ -r .code_anal ]; then \
ccode_analysis --mode 216091 --level 216193 --FNV1a_hash_256_bit "prog"; \
else \
echo "If you don't eat yer meat, you can't have any pudding!"; \
echo "How can you have any pudding if you don't eat yer meat?!"; \
fi
@${TRUE}
# The IOCCC resident astronomer states
#
charon: supernova
@echo $@ is a dwarf planet
@echo dwarf is a type of planet
@echo $@ is a planet
pluto: supernova
${MAKE} charon
@echo $@ is a dwarf planet
@echo dwarf is a type of planet
@echo $@ is a planet
@echo get used to having lots of planets because a $< can ${MAKE} a lot of them
+72
View File
@@ -0,0 +1,72 @@
<!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 likely to top the charts</title>
</head>
<body>
<h1>Most likely to top the charts</h1>
<p>Qiming HOU</p>
<h2>Judges' comments:</h2>
<h3>To use:</h3>
<pre><code>make
./prog &lt; input.json &gt; output.html
</code></pre>
<p>View <code>output.html</code> in a browser.</p>
<h3>Try:</h3>
<pre><code>grep -e '[-?+*/^&amp;|.&lt;&gt;=]' prog.c
(cd ..; ls -lS */prog.c) | \
awk 'BEGIN { print "["; } { print "{\"winner\":\"",$9,"\", \"size\":",$5,"},"} END { print "]"}' \
&gt; ioccc.json
./prog &lt; ioccc.json &gt; ioccc.html
</code></pre>
<p>What&rsquo;s not right with the output? How to fix it?</p>
<h3>Selected Judges Remarks:</h3>
<p>This entry exhibits a way of obfuscation we haven&rsquo;t seen before, we think.
The rulez of programming in an imperative language are violated, aren&rsquo;t they?</p>
<p>Try figuring out how to increase the number of different colors, if you can.</p>
<h2>Author&rsquo;s comments:</h2>
<p>Nowadays almost every programmer needs to do some Web chore. With all the open source stuff readily available, often we just need to call a bunch of libraries to generate an HTML page from a JSON feed.</p>
<p>This entry takes such decadence to an extreme. It just calls a bunch of libraries to generate an HTML page from a JSON feed, literally. There is no variable (function parameters included), no operator, no flow control statements except a few decorative returns. In compliance to production coding standards, the code is littered with fashionable jargon, doxygen comment, and license text.</p>
<p>As one would expect from such an approach, this program is much more resource intensive than it should be. And one needs a C99-compatible libc (with the common UNIX stuff) to build this and an HTML5-compatible browser to open the result. And it terminates with an assertion failure, but who cares if the web page is already generated?</p>
<hr />
<!--
(c) Copyright 1984-2018, [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-2018,
<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>
+48
View File
@@ -0,0 +1,48 @@
# Most likely to top the charts
Qiming HOU
## Judges' comments:
### To use:
make
./prog < input.json > output.html
View `output.html` in a browser.
### Try:
grep -e '[-?+*/^&|.<>=]' prog.c
(cd ..; ls -lS */prog.c) | \
awk 'BEGIN { print "["; } { print "{\"winner\":\"",$9,"\", \"size\":",$5,"},"} END { print "]"}' \
> ioccc.json
./prog < ioccc.json > ioccc.html
What's not right with the output? How to fix it?
### Selected Judges Remarks:
This entry exhibits a way of obfuscation we haven't seen before, we think.
The rulez of programming in an imperative language are violated, aren't they?
Try figuring out how to increase the number of different colors, if you can.
## Author's comments:
Nowadays almost every programmer needs to do some Web chore. With all the open source stuff readily available, often we just need to call a bunch of libraries to generate an HTML page from a JSON feed.
This entry takes such decadence to an extreme. It just calls a bunch of libraries to generate an HTML page from a JSON feed, literally. There is no variable (function parameters included), no operator, no flow control statements except a few decorative returns. In compliance to production coding standards, the code is littered with fashionable jargon, doxygen comment, and license text.
As one would expect from such an approach, this program is much more resource intensive than it should be. And one needs a C99-compatible libc (with the common UNIX stuff) to build this and an HTML5-compatible browser to open the result. And it terminates with an assertion failure, but who cares if the web page is already generated?
--------------------------------------------------------------------------------
<!--
(c) Copyright 1984-2018, [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/
-->
+8
View File
@@ -0,0 +1,8 @@
[{"brand":"Foo","sales": 1.5 },
{"brand":
"Bar"
,
"sales":4.7
}, { "sales":2.1, "brand":"Lolz" }
, { "sales":0.1, "brand":"Misc" }, { "sales":0.1, "brand":"Misc" }, { "sales":0.1, "brand":"Misc" }
]
+199
View File
@@ -0,0 +1,199 @@
/**
* \file prog.c
*
* \brief Renders an HTML chart from JSON data
*
* \author Qiming HOU
*
* Copyright (C) 2017-2018, Qiming HOU
*
* Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported
* (CC BY-SA 3.0), you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://creativecommons.org/licenses/by-sa/3.0/
*
* This file is an IOCCC submission.
*
* This thing wouldn't be possible without the advent of C / HTML standards.
* We all love the new math functions in C99 and the inclusion of SVG in
* HTML5.
*
* Changelog:
* 2018-04-16 fixed the rounding bug
*/
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
/* Macros are named after fashionable jargon */
#define J ceil(log(erfc(1)))
#define S calloc(3, 1)
#define O strcat(strcat(S, m(37)), m(102))
#define N I(T(6))
#define _(X) mmap(fopen(S, S), 64, 3, 1, X, 0)
#define H(X) dup2(fileno(tmpfile()), X); m(ftruncate(X, 64))
#define T(X) getenv(L(r(1, X, 64)))
#define M(X, Y) memcmp(T(X), L(Y), 1)
#define L(X) memset(S, X, 1)
#define m(X) memset(S, X, N)
#define o(X) r(copysign(1, X), exp2(J), exp2(J))
#define b(X) o(r(abs(X), J, 0))
#define i(X) setenv(L(70), L(r(1, X, 48)), 1)
#define l(X, Y) setenv(m(r(1, X, 64)), L(Y), 1)
#define e(X) setenv(m(r(1, X, 64)), \
strcat(strcpy(malloc(r(p(T(X)), 1, 2)), T(X)), T(4)), 1)
#define W(X) printf(O, fabs(X))
#define E(X) putchar(r(N, X, 32))
#define B(X, Y) sprintf(_(r(N, X, 3)), O, Y)
#define j(X) t; E(55); E(41); E(36); E(52); E(40); E(29); W(X); t; E(40); \
E(37); E(41); E(39); E(40); E(52); E(29); W(X)
#define a(X) l(8, 0); i(o(M(8, X)))
#define v t; E(16); t
#define A E(52); E(37); E(56); E(52)
#define s W(r(200, sin(I(_(4))), 250)); t; W(r(200, cos(I(_(4))), 250))
#define c E(38); E(41); E(44); E(44); E(29); E(50); E(39); E(34); E(8); \
W(r(cos(p(T(2))), 48, 48)); E(5); E(12); E(16); E(5); E(12); \
W(r(sin(p(T(2))), 48, 48)); E(5); E(9); t; E(15); E(30); e(2)
#define r fma
#define I atof
#define p strlen
#define t E(0)
#define rulez o(r(J, exp2(N), p(T(1))))
/**
* @brief Renders the chart from JSON input
*
* Expected input format:
* [ {"foo": string, "bar": number}, ... ]
*
* @return nothing
*/
int C(){
i(1);
l(4, getchar());
l(8, r(
I(T(5)), 4,
r(N, o(M(4, 33)), r(N, b(M(4, 44)), r(b(M(4, 34)), 2, 1)))
));
i(0);
a(13);
E(28);
E(48);
E(33);
E(52);
E(40);
t;
E(36);
E(29);
E(7);
E(45);
W(250);
t;
W(250);
E(44);
s;
B(1, r(
exp2(r(J, log2(I(_(5))), log2(I(T(1))))),
r(2, acos(J), 0),
I(_(4))
));
E(33);
W(200);
t;
W(200);
v;
E(r(1, o(r(2, I(T(1)), r(J, I(_(5)), 0))), 16));
v;
s;
E(58);
E(7);
c;
setenv(m(65), strchr(T(1), r(1, I(T(7)), 9)), 1);
l(7, r(J, I(T(7)), 49));
fflush(fopen(S, S));
assert(rulez);
a(12);
l(5, 48);
E(28);
E(15);
A;
E(30);
a(9);
m(write(1, T(4), N));
a(8);
l(5, 50);
E(28);
E(50);
E(37);
E(35);
E(52);
j(16);
t;
E(56);
E(29);
W(472);
t;
E(57);
E(29);
W(r(p(T(2)), 28, 0));
t;
c;
E(28);
A;
t;
E(56);
E(29);
W(500);
t;
E(57);
E(29);
W(r(p(T(2)), 28, r(J, 16, 0)));
E(30);
a(7);
l(5, 48);
l(4, r(1, I(T(7)), 9));
e(1);
l(7, r(J, I(T(7)), 49));
B(2, r(1, I(_(5)), I(strrchr(T(r(N, J, 2)), r(N, I(T(7)), 9)))));
a(6);
e(1);
a(1);
i(r(N, b(M(4, 58)), 0));
l(5, 49);
a(1);
i(r(N, b(M(4, J)), 0));
l(7, 9);
l(5, 51);
l(2, 9);
return C();
}
int main(){
i(1);
E(28);
E(51);
E(54);
E(39);
j(r(2, 250, 250));
E(30);
l(1, 10);
l(2, 9);
l(8, 9);
l(4, 9);
l(5, 9);
l(7, 9);
H(3);
H(4);
H(5);
return C();
}
+197
View File
@@ -0,0 +1,197 @@
/**
* \file prog.c
*
* \brief Renders an HTML chart from JSON data
*
* \author Qiming HOU
*
* Copyright (C) 2017-2018, Qiming HOU
*
* Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported
* (CC BY-SA 3.0), you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://creativecommons.org/licenses/by-sa/3.0/
*
* This file is an IOCCC submission.
*
* This thing wouldn't be possible without the advent of C / HTML standards.
* We all love the new math functions in C99 and the inclusion of SVG in
* HTML5.
*
*/
#include <math.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
/* Macros are named after fashionable jargon */
#define J ceil(log(erfc(1)))
#define S calloc(3, 1)
#define O strcat(strcat(S, m(37)), m(102))
#define N I(T(6))
#define _(X) mmap(fopen(S, S), 64, 3, 1, X, 0)
#define H(X) dup2(fileno(tmpfile()), X); m(ftruncate(X, 64))
#define T(X) getenv(L(r(1, X, 64)))
#define M(X, Y) memcmp(T(X), L(Y), 1)
#define L(X) memset(S, X, 1)
#define m(X) memset(S, X, N)
#define o(X) r(copysign(1, X), exp2(J), exp2(J))
#define b(X) o(r(abs(X), J, 0))
#define i(X) setenv(L(70), L(r(1, X, 48)), 1)
#define l(X, Y) setenv(m(r(1, X, 64)), L(Y), 1)
#define e(X) setenv(m(r(1, X, 64)), \
strcat(strcpy(malloc(r(p(T(X)), 1, 2)), T(X)), T(4)), 1)
#define W(X) printf(O, floor(X))
#define E(X) putchar(r(N, X, 32))
#define B(X, Y) sprintf(_(r(N, X, 3)), O, Y)
#define j(X) t; E(55); E(41); E(36); E(52); E(40); E(29); W(X); t; E(40); \
E(37); E(41); E(39); E(40); E(52); E(29); W(X)
#define a(X) l(8, 0); i(o(M(8, X)))
#define v t; E(16); t
#define A E(52); E(37); E(56); E(52)
#define s W(r(200, sin(I(_(4))), 250)); t; W(r(200, cos(I(_(4))), 250))
#define c E(38); E(41); E(44); E(44); E(29); E(50); E(39); E(34); E(8); \
W(r(cos(p(T(2))), 48, 48)); E(5); E(12); E(16); E(5); E(12); \
W(r(sin(p(T(2))), 48, 48)); E(5); E(9); t; E(15); E(30); e(2)
#define r fma
#define I atof
#define p strlen
#define t E(0)
#define rulez o(r(J, exp2(N), p(T(1))))
/**
* @brief Renders the chart from JSON input
*
* Expected input format:
* [ {"foo": string, "bar": number}, ... ]
*
* @return nothing
*/
int C(){
i(1);
l(4, getchar());
l(8, r(
I(T(5)), 4,
r(N, o(M(4, 33)), r(N, b(M(4, 44)), r(b(M(4, 34)), 2, 1)))
));
i(0);
a(13);
E(28);
E(48);
E(33);
E(52);
E(40);
t;
E(36);
E(29);
E(7);
E(45);
W(250);
t;
W(250);
E(44);
s;
B(1, r(
exp2(r(J, log2(I(_(5))), log2(I(T(1))))),
r(2, acos(J), 0),
I(_(4))
));
E(33);
W(200);
t;
W(200);
v;
E(r(1, o(r(2, I(T(1)), r(J, I(_(5)), 0))), 16));
v;
s;
E(58);
E(7);
c;
setenv(m(65), strchr(T(1), r(1, I(T(7)), 9)), 1);
l(7, r(J, I(T(7)), 49));
fflush(fopen(S, S));
assert(rulez);
a(12);
l(5, 48);
E(28);
E(15);
A;
E(30);
a(9);
m(write(1, T(4), N));
a(8);
l(5, 50);
E(28);
E(50);
E(37);
E(35);
E(52);
j(16);
t;
E(56);
E(29);
W(472);
t;
E(57);
E(29);
W(r(p(T(2)), 28, 0));
t;
c;
E(28);
A;
t;
E(56);
E(29);
W(500);
t;
E(57);
E(29);
W(r(p(T(2)), 28, r(J, 16, 0)));
E(30);
a(7);
l(5, 48);
l(4, r(1, I(T(7)), 9));
e(1);
l(7, r(J, I(T(7)), 49));
B(2, r(1, I(_(5)), I(strrchr(T(r(N, J, 2)), r(N, I(T(7)), 9)))));
a(6);
e(1);
a(1);
i(r(N, b(M(4, 58)), 0));
l(5, 49);
a(1);
i(r(N, b(M(4, J)), 0));
l(7, 9);
l(5, 51);
l(2, 9);
return C();
}
int main(){
i(1);
E(28);
E(51);
E(54);
E(39);
j(r(2, 250, 250));
E(30);
l(1, 10);
l(2, 9);
l(8, 9);
l(4, 9);
l(5, 9);
l(7, 9);
H(3);
H(4);
H(5);
return C();
}