/2004/vik1.c
C | 63 lines | 50 code | 12 blank | 1 comment | 2 complexity | cc5856851fb3ee57c42d1df43830cf69 MD5 | raw file
- #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; }