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,15 @@
|
||||
LDFLAGS+=-L${X11_LIBDIR} -lX11 -lm
|
||||
build: vik
|
||||
|
||||
clean:
|
||||
|
||||
clobber:
|
||||
-rm vik
|
||||
|
||||
vik: vik.c
|
||||
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@
|
||||
|
||||
alt:
|
||||
|
||||
data:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,110 @@
|
||||
# Most circuitous walk
|
||||
|
||||
Daniel Vik
|
||||
926 Genter Street
|
||||
La Jolla Ca 92037
|
||||
USA
|
||||
daniel@vik.cc
|
||||
|
||||
## Judges' comments
|
||||
|
||||
An amazing use of the X libraries with twisty code passages,
|
||||
all different. One risks running in code path circles as main is
|
||||
called again and again. be sure to pay attention to commas! :-)
|
||||
|
||||
### To build
|
||||
|
||||
cc -O3 -ansi vik.c -L/usr/X11R6/lib -lX11 -lm -o vik
|
||||
|
||||
### To run
|
||||
|
||||
vik
|
||||
vik maze.map
|
||||
|
||||
## Author's comments
|
||||
|
||||
This entry is a Wolfenstein style graphics engine where a user can navigate in
|
||||
a 3D world. The maze has walls with bitmap textures. The application contains
|
||||
a default world with textures, but the power of the engine is exposed through
|
||||
user configured maps. User defined worlds support up to 26 different wall
|
||||
textures that can even be animated. One example of a user defined world is
|
||||
submitted with the entry.
|
||||
|
||||
### Features
|
||||
|
||||
This program is a complete 3D engine with
|
||||
|
||||
* Easy configurable maze maps
|
||||
* Up to 26 differnt bitmap textures in a maze
|
||||
* Support for animated bitmap textures
|
||||
* Uses default bitmaps in case the configured bitmaps can't be found
|
||||
* A default map in case no one is specified
|
||||
* Configurable window size
|
||||
* Navigation using cursor keys (rotate left and right, move forward and
|
||||
backward)
|
||||
|
||||
### Build and Run
|
||||
|
||||
Compile the source code and link x libraries if nessecary. The program takes
|
||||
three options which have to be typed in a specific order as described below.
|
||||
|
||||
Usage: prog [-w <width>] [mapfile]
|
||||
width - Specifies the width of the window
|
||||
mapfile - Filename containing a map
|
||||
|
||||
Here are a few examples:
|
||||
|
||||
> | Command line: | Description: |
|
||||
> | ------------------------ | ---------------------- |
|
||||
> | $ ./prog | Starts the engine using a built in labyrinth and texture bitmaps |
|
||||
> | $ ./prog maze.map | Starts the engine and loads the labyrinth defined in the file maze.map |
|
||||
> | $ ./prog -w 400 maze.map | Starts the engine using maze.map in a window that is 400 pixels wide |
|
||||
|
||||
Note that the mapfile has to be the last argument and the -w option if present
|
||||
has to be the first. The map definition files and the bitmap files should be
|
||||
located in the current directory.
|
||||
|
||||
Use the cursor keys to navigate through the labyrinth.
|
||||
|
||||
### Creating mazes
|
||||
|
||||
A maze consist of a map file and texture bitmap files. The map file is an
|
||||
ascii text file where lower case letters represent walls. The letter tells the
|
||||
engine what bitmap texture file to use. The '*' character lets the engine know
|
||||
where to position the user. The example below shows how a map file can look:
|
||||
|
||||
aaaaaaaaaaaaa
|
||||
a a
|
||||
a * a
|
||||
a bbbb cccccccc
|
||||
c c
|
||||
cccccccccccccccccccc
|
||||
|
||||
The engine loads the map, and creates walls. When a character 'a'-'z' is found,
|
||||
the engine will load the corresponding texture bitmap. The bitmap file must be
|
||||
named `*.bmp` where `*` is substituted with the letter of the wall in the map.
|
||||
|
||||
So to load the map above, the files `a.bmp`, `b.bmp`, and `c.bmp` should be
|
||||
located in the same directory as the engine executable (or rather in the
|
||||
current directory).
|
||||
|
||||
### Obfuscation
|
||||
|
||||
The program is obfuscated in several ways, bad use of variables, use of the ?
|
||||
operator, recursive calls to main, bad use of for variables and the comma
|
||||
operator. To make the final obfuscated touch I ran indent which really made
|
||||
the program unreadable (I guess that is not really the intent with indent ;)
|
||||
|
||||
### Compiler warnings
|
||||
|
||||
There are no compiler warnings when compiling with -ansi but there are quite
|
||||
many warnings from lclint. Mainly because the program is very optimized for
|
||||
code size.
|
||||
|
||||
### Limitations
|
||||
|
||||
The program only compiles and runs on X based systems.
|
||||
|
||||
The program does not run that smooth under cygwin. It seems to be a priority
|
||||
issue with cygwin and it can easily be solved by increasing the priority of
|
||||
the application a little bit.
|
||||
@@ -0,0 +1,18 @@
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
a a
|
||||
a b a
|
||||
a * a
|
||||
a a
|
||||
aaaaa aaaaaaaa aaaaaaaaaaaa
|
||||
ccccc c a a
|
||||
c c a a
|
||||
c c a a a
|
||||
c ccccccca a a
|
||||
c ca a a
|
||||
c ca a a
|
||||
c caaaaaa a a
|
||||
c cccc ccccccaaaaaa a
|
||||
c cccc ca a
|
||||
c cb a
|
||||
c ca a
|
||||
ccccccccccccccccccccccaaaaaaaaaaaa
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
#include<math.h>
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<sys/time.h>
|
||||
#include<X11/Xlib.h>
|
||||
#include<X11/keysym.h>
|
||||
Window L;
|
||||
GC N;
|
||||
Display *K;
|
||||
XEvent O;
|
||||
XImage *Q;
|
||||
float w, x, y[7 << 16];
|
||||
struct timeval S, U;
|
||||
int a, b, c, d =
|
||||
92, e, f, g, h, i, j, k, l, m, n, o, p, *q[96], r[7 << 16], s[96], *t,
|
||||
*u = r, *v, P = 256, R[64], T, J = 12288;
|
||||
struct
|
||||
{
|
||||
int a, b, c, d, e;
|
||||
} A[9999], *B, *G, *H;
|
||||
unsigned char C, D[9999], *E = D, F[] = " .bmp";
|
||||
FILE *I;
|
||||
|
||||
#define Q(o,X,Y,C)B->b=b+32*o,B->c=c+32*X,B->d=Y,B->e=C,B++->a=l,
|
||||
#define D(o,X)(int)((X*(B->b-e)-o*(B->c-f))/(x*B->e-w*B->d))
|
||||
|
||||
int
|
||||
main (int X, char **Y)
|
||||
{
|
||||
for (j = J << 8, x = y[i], w = y[i + 32], B = A; k = D (x, w), B->b;
|
||||
k >> 8 ? 0 : (l = D (B->d, B->e), l > 0
|
||||
&& l < j) ? j = l, h = k, g = B->a : 0, B++);
|
||||
for (;
|
||||
X
|
||||
&& (p =
|
||||
1 | 3 * (o = (--X < 2 || 119 - 1[Y[1]] ? 320 : atoi (2[Y]))) / 4);)
|
||||
{
|
||||
for (e = f = J / 2, K = XOpenDisplay (0); m < o << 8;
|
||||
y[m] =
|
||||
sin ((m & 255) / 20.4 + asin ((m / P - o / 2) / 3.2 / o)),
|
||||
D[m & 511] = 10 + d * !(1 & (m >> 3 & m)), r[m++] =
|
||||
m / 18 << (16 & (m >> 6 ^ m)));
|
||||
for (N =
|
||||
XCreateGC (K, L =
|
||||
XCreateSimpleWindow (K, RootWindow (K, 0), 0, 0, o, p,
|
||||
0, 0, 0), 0, 0), ((I =
|
||||
fopen (X ?
|
||||
Y[X]
|
||||
: "",
|
||||
"r")) ?
|
||||
fread (E + 1,
|
||||
1,
|
||||
1 << 15,
|
||||
I),
|
||||
fclose (I) :
|
||||
0), B = G =
|
||||
A + J / 3; *++E; f = l == 32 ? e = b + 99, c + 99 : f)
|
||||
for (l = *E - 10, *F = *E, k = !l, b *= !k, c += P * k, b += P;
|
||||
l > 54 && l < 96
|
||||
&& (Q (0, 0, 1, 0) Q (8, 0, 0, 1) Q (8, 8, -1, 0)
|
||||
Q (0, 8, 0, -1)
|
||||
! q[l] && (s[l] = 1, q[l] = u, I = fopen (F, "r"))); l = J)
|
||||
for (q[l] = ++u + 19, m = 2;
|
||||
n = (m++ % 3 ? n : 0 ** ++u) >> 8 | C << 16, *u =
|
||||
n, 0 < fread (&C, 1, 1, I)
|
||||
|| (m /= J, s[l] = m ? m : 1) * fclose (I););
|
||||
for (XMapWindow (K, L),
|
||||
XSelectInput (K, L, KeyPressMask | KeyReleaseMask), H = A; G->b;
|
||||
*H = *G++, H += !B->b)
|
||||
for (B = A + J / 3;
|
||||
B->b && !(B != G && B->b == G->b - 128 * (B->d - G->d)
|
||||
&& B->c == G->c - 128 * (B->e - G->e)); B++);
|
||||
for (Q =
|
||||
XCreateImage (K, DefaultVisual (K, 0), DefaultDepth (K, 0),
|
||||
ZPixmap, 0, (char *) (v =
|
||||
malloc (4 * o * p)), o, p,
|
||||
32, 0);
|
||||
d = (d + R[19] - R[17]) & 127, n = R[18] - R[20], n ? (i =
|
||||
o * 128 +
|
||||
d + (n <
|
||||
0) *
|
||||
64, main (0,
|
||||
Y)
|
||||
>
|
||||
200) ? e +=
|
||||
(int) (y[i] * 64), f += (int) (y[i + 32] * 64) : 1 : 1;
|
||||
XSync (K, 0), gettimeofday (&S, 0), m = T - S.tv_usec)
|
||||
{
|
||||
for (T -=
|
||||
(m > 0
|
||||
&& m < J * 4 ? U.tv_usec =
|
||||
m, select (0, 0, 0, 0, &U) : m) - 4 * J, a =
|
||||
a + 1 & -1 >> 1, m = 0;
|
||||
k =
|
||||
1 +
|
||||
(int) (p * 512 /
|
||||
((i = m * P + d, g = n =
|
||||
0, main (0, Y)) * y[m * P + 32])), m < o; m++)
|
||||
for (t = g ? c =
|
||||
64 * s[g], q[g] + h / 4 + 64 * (a / 3 % s[g]) : t;
|
||||
l = 32 - (17 << (k < 2)) * (2 * n - p) / k, n < p;
|
||||
v[m + o * n++] = l >> 6 ? 4477904 << (l < 0) : t[c * l]);
|
||||
for (XPutImage (K, L, N, Q, 0, 0, 0, 0, o, p); XPending (K);
|
||||
R[63 & XLookupKeysym (&O.xkey, 0 & XNextEvent (K, &O))] ^=
|
||||
O.type == KeyPress || O.type == KeyRelease);
|
||||
}
|
||||
}
|
||||
return j;
|
||||
}
|
||||
Reference in new issue
Block a user