Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,63 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/time.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
#define Z(a)main(a,T)
|
||||
Window L;
|
||||
#define J (K,
|
||||
GC N;
|
||||
#define I ; for(
|
||||
int g,h,i,j,k,l,m,n,p,q,r,v,w,x,y,z,
|
||||
#define W(a)(y/v*!w+((S+1)>>a&255)*(D+y/(z|w-2))/D)<<a|
|
||||
o,b,f,u,s,c,a,t,e,d, C
|
||||
#define U (struct timeval*)H
|
||||
[1<<18],A=100,B=4,D=200,E=53300,F=65793,H[4];
|
||||
#define V(a)#a": %1d'%02d\"%02d "
|
||||
Display*K; Pixmap M; char P[99]; int main
|
||||
#define Y(a,b)(a<b?a:b)
|
||||
(int S,char**T){
|
||||
#define X(a)\
|
||||
XDrawLine J M,N,D+l a m,o,D+l a n,o),
|
||||
XEvent O I p=E/5; --S&~1?
|
||||
XSetForeground J N,W(0)W(8)W(16)0),X(-)X(+)gettimeofday(U,0):S?z=97
|
||||
== ** ++ T,w=A==z[*T],B-=w[z+*T]%3,S:++S;
|
||||
XCopyArea J M,L,N,0,0,e,D,0,0),
|
||||
XSync J 0),
|
||||
XFlush (K),select(0,0,0,0,U+1)){ I 3[H]=F; p==++r?K=
|
||||
XOpenDisplay (0),N=
|
||||
XCreateGC J L=
|
||||
XCreateSimpleWindow J RootWindow(K,0),0,0,e=D*2,D,0,0,0),0,0),
|
||||
XSelectInput J L,KeyPressMask|KeyReleaseMask),
|
||||
XMapWindow J L),M=
|
||||
XCreatePixmap J L,e,d=D,DefaultDepth(K,0)),u=h=q=E:r<p?a=r/D%6,r[C
|
||||
+p]=(l+=!a|a%2?g:a-3)/4,r[C]=2*r<=p?(n+=(i-=(i+34&&r
|
||||
/149%B)-(i-34&&r/353%3)))/55:C[p-r],v=4-3*z:
|
||||
XPending (K)?C[F+
|
||||
XLookupKeysym (&O.xkey,0&
|
||||
XNextEvent J&O))]^=O.type==KeyPress||O.type==KeyRelease,p:0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Some more code */
|
||||
|
||||
|
||||
)I k=C[F+XK_Right]-C[F+XK_Left],j=k?j+v*k*(j*k<8):j*.9,u+=(s=Y(C[F+XK_space]*
|
||||
3+s-!!s,a))/9,c=u>p?q=Y(h,q),u%=p,Z(c=0):c,t+=j*(s+A)/e-s/i*(C[u+4]-C[u]),s=t
|
||||
*t>p?t*=.97,s*.8:g>a&&b*b<D*9?i:s,i=k=l=0,o=n=e; i-5; Z((k/17?o++==y?m=n=D,f
|
||||
-=A,o=30+9*i++:0,n-=2,m+=3,l=f/.7,y*F+A-i*k:k|!o?f=l=C[u]/-2-t,k+=17*w,o=k+++
|
||||
20,n=k+k-k*k/9,F*p:o--<a?y=135,A*F|D:0)))I x=g=m=f=0,a=i=u+D,d+=9; o<f?n=2*e,
|
||||
Z(z?r+k*F*8:E-k*A*A),n=9+x/D,Z(!k+z?r=D*F+9:A<<17),n-=x/9/D,Z(i%p>6?h=r*(3+z)
|
||||
/5:r),n=x/13/e,Z(k?h:r),o++:(f=x/D+70+C[i+p]-C[u+p],o=x?o:f,k=2*i/41%2,l=C[--
|
||||
i]-C[u]-t,x+=D-(y=i-u),g=(d-i)%410?g:(a=o,b=l+B*x/e,x)/A,i>u); )I k=i=0,x=g,
|
||||
l=b; ++i==41+!f&&k?f=k=i=l=0,x=190,a=163:i==42?i=9,k=r:!k|i-41; n=(Y(Y(Y(75,A
|
||||
-i)/3,95-2*i),r-k+2*i)-k/r)*x/D,m=i<9?x*14/D:k?(i-31)/5*(i%12)?0:n-1:0,o=a-i*
|
||||
x/D,y=D-o,h=Z(k*r+k*f/F))I B=g?B:1-h%3,i=60,y=n=m,XDrawString J M,N,30,x,P,
|
||||
sprintf(P,V(Time)V(High)"Speed: %03dmph",h/A/i,h/A%i,h%A,q/A/i,q/A%i,q%A,s,Z(
|
||||
A<<17))),x=h; ++f<2*z*e; l=(x*=3)%e,o=x*x%a,Z(-1)); } return A**H+1[H]/p-c; }
|
||||
@@ -0,0 +1,142 @@
|
||||
Best X11 Game:
|
||||
|
||||
Daniel Vik
|
||||
926 Genter Street
|
||||
La Jolla, Ca 92037
|
||||
USA
|
||||
|
||||
http://www.vik.cc/
|
||||
|
||||
|
||||
Judges' Comments:
|
||||
|
||||
To build:
|
||||
|
||||
# you may have to edit the Makefile to set X11_LIBDIR correctly
|
||||
make vik1
|
||||
|
||||
Try:
|
||||
|
||||
# requires an X11 server
|
||||
./vik1
|
||||
./vik1 a
|
||||
./vik1 d2
|
||||
./vik1 ad3
|
||||
|
||||
Danial Vik has presented a tour de force feature rich X11-based
|
||||
racing game that fit within the contest size limits. Take a
|
||||
glace at the feature list he provided below. Amazing!
|
||||
|
||||
Happy touring on the road and in the code!
|
||||
|
||||
|
||||
Selected Author's Comments:
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
This program is a complete car race game with a lot of nice features:
|
||||
|
||||
* Drive on a road in a 3-d landscape with hills and curves
|
||||
|
||||
* Mountains in the horizon
|
||||
|
||||
* A sun in the sky when driving during the day.
|
||||
|
||||
* Dark sky and reduced visibility when driving at night.
|
||||
|
||||
* Snow when driving in the winter.
|
||||
|
||||
* Slippery road when driving in the winter.
|
||||
|
||||
* When driving off the road, the car slows down to a halt
|
||||
|
||||
* Three different race tracks that takes about one minute to
|
||||
complete.
|
||||
|
||||
* Speed meter.
|
||||
|
||||
* Computer driven opponent cars.
|
||||
|
||||
* Collision detection when driving into other cars.
|
||||
|
||||
* Lap time measurement.
|
||||
|
||||
* The best lap time is stored as reference.
|
||||
|
||||
|
||||
Build and Run
|
||||
=============
|
||||
|
||||
Compile the source code and link x libraries if necessary.
|
||||
The program takes three options which have to be typed in a specific
|
||||
order as described below.
|
||||
|
||||
Usage: vik1 ['a']['d'][#]
|
||||
|
||||
a - Advanced racing in a winter landscape
|
||||
d - Racing in at night in the dark
|
||||
# - Race track selection 1-3 are valid numbers
|
||||
|
||||
Here are a few examples:
|
||||
|
||||
Command line: Description:
|
||||
$ ./vik1 Run track 1 at daytime in the summer
|
||||
$ ./vik1 a Run track 1 at daytime in the winter
|
||||
$ ./vik1 d Run track 1 at night in the summer
|
||||
$ ./vik1 3 Run track 3 at daytime in the summer
|
||||
$ ./vik1 d3 Run track 3 at night in the summer
|
||||
$ ./vik1 ad2 Run track 2 at night in the winter
|
||||
|
||||
Note that the order in which the argument characters are entered is
|
||||
important. It is for example not possible to type ./vik1 da. (Well it is
|
||||
possible, but the result will not be as expected.)
|
||||
|
||||
The space key accelerates the car. Releasing the space key slowly
|
||||
reduces the speed. The left and right arrow keys are used to steer the
|
||||
car.
|
||||
|
||||
|
||||
Obfuscation
|
||||
===========
|
||||
|
||||
The main obfuscation is the fact that the program is extremely compact.
|
||||
There are a few things I didn't want to do, e.g. define #define to a
|
||||
single letter to save some space, or to remove casts to save some space.
|
||||
|
||||
The program uses a lot of variables. In fact, all letters a-z are used
|
||||
and most letters A-Z.
|
||||
|
||||
The constants are chosen very carefully and thy have multiple purposes,
|
||||
e.g. a constant can be both the length of the track and a color.
|
||||
|
||||
Most of the code is kept inside five for loops without body. Each for
|
||||
loop does many things. One for loop draws all cars by restarting a
|
||||
couple of times. Another draws the road, mountains, and the sun.
|
||||
|
||||
Main is called recursively. The return value and output depends on the
|
||||
arguments. main can return the current time, draw lines and of course be
|
||||
the entrypoint of the application.
|
||||
|
||||
The program frequently uses the ? operator mainly to save space but it
|
||||
makes the program more obscure.
|
||||
|
||||
|
||||
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 requires a display with 24 bit color depth. It also assumes
|
||||
that the byte order of the colors are as on my Linux PC. That is, The
|
||||
colors are represented by a 32 bit value where the bytes (from high to
|
||||
low) are { 0, RED, GREEN, BLUE }.
|
||||
|
||||
Reference in new issue
Block a user