restore *.orig.c to each entry

Under each yyyy/dir there is a file of the form '*.orig.c'
containing the original source code, or as close as we can
get to the original source code.
This commit is contained in:
Landon Curt Noll committed 2023-07-06 21:49:38 -07:00
1 parent cfd253683f
commit 2ba12ecc3c
320 files changed
+21365

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
#include <stdio.h>
#include <stdlib.h>
#define N(I,l) s l]=(I?1<<I|I<<10:01776)
#define f(a,t) for(a=0;a<t;a++)
#define Su(d,o,ku) O(l/9,d) O(l%9,o) O(l%9/3+l/27*3,ku)
#define NO ;printf("%c %s",I?I|48:46,++l%3?"":l%9?"| ":l%27?"\n":l%'Q'?z:"\n");
#define Ba(k,a) {O||printf("!!! " #a " %i\n",k+1);goto l;}
#define O(o,k) f(l,9) c[l]= *#k?0x3fe:-1;\
f(l,81) if(*#k){\
if(!(s]&c[o])) Ba(o,k) c[o]&=~(1<<(s]>>10));\
} else if((s]>>l0)&1) c[o]=c[o]+1?-2:l;\
if(*#k) { f(l,81) if(s]>>10||(s]&=c[o]),!s]) Ba(o,k) }\
else f(l,9) l[c]<0||s[c]]>>10||(N(l0,[c]),C++);
struct{ int s[81],I,l,O; } S[0123];
int I, l, l0, o, C, O=0, w=0, c[10], L; long i;
char z[] = "\007 & & \n";
#define s S].s[l
int main(int n,char**N) {
S->O=0; L=n>1?*N[1]-85?1:6:0; i=L&1?atol(N[1]):123;
#define i (int)(81.0*(i=1103515245*i+12345&0x7fffffff)/2147483648.0)
for(l=C=0;l<81;) {
I=L&1?0:getchar()^48; i; I=I-30?I:0;
if(I<10) {
#define S S[O
if(C<22) z[C++]^=13; N(I,)NO
}
}
for(;;) {
l0:
Su(row,col,box) C=l0=0;
f(l,81) if(!(s]>>10&&++l0)) {
o=s]&1022; for(I=0;~o&1&&(o/=2);I++); o-1||(s]|=I<<10,C++);
} if(l0==l) {
if(O&&L&2) { O--; goto l0; } goto O;
} for(l0=1;10>l0;l0++) { Su(,,) }
if(!C) {
l=(o=S].O)?S].I:0; I=o?S].l%9+1:(S].O=i%9+1);
for(;l<81;l++,I=S].O,o=0) if(!(s]>>10)) {
for(;;I=I%9+1,o=1) {
l0=0; if(o&&I==S].O) goto O;
if(s]>>I&1) {
S].l=I; S++].I=l; S]=S-1];
N(I,); O>w&&(w=O); goto lO;
}
}
}
}
lO: S].O=0; goto l0; l: if(!(l0=O)) { L=0; goto O; } O--;
s,S].I] &=~ (1<<S].l);
}
O: switch(L) {
case 2: if(l0) {
case 3: O=82;
for(S].l=l=i%81;l0||S].l-l;l=(l+1)%81)
O1: if(l0=0,S].O=s]>>10,~s]&1) {
s]=1023; S].I=l; S&0]=S]; w=O=0; L=2; goto lO;
}
L=0; l0=1;
} else {
l=S=82].I; N(S].O,)|1; goto O1;
}
}
printf("\n\n"); for(l=0;l<81;) {I=s]>>10 NO}
printf("\n%s (stk %i %i)\n",l0?"Done":"No way!",O,w);
L|=2; if(L-3||!l0) return!l0; S,82]=S]; goto O;
}
+178
View File
@@ -0,0 +1,178 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* Defines */
#ifndef NO_STTY
#define S1 system("stty cbreak -echo")||
#define S2 system("stty sane")||
#else
#define S1
#define S2
#endif
#define A(i) (((q*)R(8))[i])
#define B p(b)
#define C p(&a)
#define H(i) sscanf(A(i),"%ld",&R(i+11))&0 ||
#define P q*
#define M(a,b) main((i)(a),(P)(b))
#define p(x) ((i*)(x))
#define D T(B-C,C-B)
#define T(x,y) ((a&1)*((i)(x))+(~a&1)*((i)(y)))
#define R(x) (*(B+x))
#define q char*
#define Q(x) ((q)(x))
#define W(x,y) ((B[x]=(i)(y))&0)||
#define BS (w*l*h)
#define do(x,y) (a-x||y)&&
#define f(x) M(x,b)
#define if(p,q,r,s) ((p)&&!(q)||(s))&&(r)||
#define i long
#define I (int)
#define while(x,y,z) do(x, y && !(z) && f(a))
#define for(s,i,x,y,z,Z) W(i,x)f(s)||Z) && while(s,R(i)-y,z||W(i,R(i)+1)0)(s
#define return return do
#define w R(12)
#define l R(13)
#define h R(14)
#define X(i) (R(i)%w)
#define Y(i) ((R(i)%(w*l))/w)
#define Z(i) (R(i)/(w*l))
#define pr !printf
#define switch(x) (W(32+R(15),R(32+x+R(15))) W(32+x+R(15),0) (B[15]+=x)|1)
#define case(k,x,y) R(a)==k && x && switch(y) && f(13)||
#define TL(i) R(32+R(i))
/* Main program */
int main(int a, P b) {
return(1>>1^1, M(6+!!M(5,C),C))
do(
13,
pr("\x1b[;H")||
for(14,4,0,BS,!X(4)&&pr(
"%*s",
I(l-Y(4)),
""
)
||
if(TL(4),pr(
"%*ld",I
R(31),
TL(4)),0,
pr("%*.*s",I
R(31),
I R(31),"#####")
)
if(X(4)==w-1 , pr("\n"),0 , pr("%*s", I(l+1), "")) (
(R(4)+1)%(w*l)==0 && l>1)&&
pr("\n"),0))
do(
1&~1,
pr("Syntax: %s <x> <y> [<z>]\n", b[0])||f(15)
)((a&~1)
-6||D>>12
&&(*(p(T(C,b))+8)=*p(Q(b)+(Q(&b)-Q(C)))
)
&&(*(p(T(C,b))+9) = *p(b))&&M(
8,T(C,b))
||
f( a) )&&do(
8,
if(R(9)&1,H(1)H(
2 ) 0,W(14,
l)W(13,1)0,
H(1
)
H(2)
H(3)
0)(srand(time(0)),0
) ||for(9,4, 0,BS, f(16)
|| W(R(4)+32,R(0))!R(0) && W(15,R(4) )0,
W(
31,
snprintf(A(0),1,"%ld",BS))
S1 pr("\x1b[2J") ||
f(13)
||
f(18) ||
f(15)
))
do(
16,W(0,rand()%BS
) W(1,0)
for(17, 5, 0,R(4),! (
TL(
5)-R(0))&&! (
W(1,1)
W(5,R(4)-1)
0),R(1)&&f(16))
)
do(
18,W(0,0
) for(19,4,0,BS, TL(4)-(R(4)+1)
%BS&& (
W(0,1)
W(4,BS-1
) 0)||0,!R(0) &&
pr(
"You win!\n"
)
||
R(0)&& (
W(a,getchar())
case('i',
0<Z(15),
-w*l)
case('j',
0<X(15),
-1)
case('k',
Z(15)<h-1,
w*l)
case('l',
X(15)<w-1,
1)
case('n',
Y(15)<l-1,
w)
case('o',
0<Y(15),-w
)
R(a)=='q'&&!
pr(
"You lose :-)\n"
)
&&f(15)||f(a))
)
)
do(
15,S2
(exit(0),a)
) (a-5||C<p(b));
}
+75
View File
@@ -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;
}
+82
View File
@@ -0,0 +1,82 @@
/*
* Sun's Java is often touted as being "portable", even though my code won't
* suddenly become uber-portable if it's in Java. Truth is, Java's one of
* the most ugly, slow, and straitjacketed languages ever. It's popular
* mainly because people hear the word "portable" and go "ewww".
*
* This program, then, is dedicated to bringing about the death of Java. We
* good coders have been oppressed for too long by the lame language
* decisions of pointy-haired bosses and academics who should know better.
* It's time we stand up against this junk, and bring back the fun in
* programming! Viva La Revolution!
*/
#define aSet c
#define BufferedReader(x)1
#define byte Y[I][_^1]?do(:):_&1?do(.):do(`):8;++y;}
#define class int N=0,_,O=328,l=192,y=4,Y[80][64]={0},I;struct
#define do(c)a(#c "\b")
#define err c,c
#define getAllStrings(x));q()
#define if(x)b(#x)
#define IOException
#define line c
#define main(a)b(char*x){write(1,"\033[",2),null}main()
#define new
#define null a(x);}a(char*x){write(1,x,strlen(x));try;try;try;try;
#define out c,c
#define println(x)c
#define private int d(int
#define public short c;}c;typedef int BufferedReader;char*F="JF>:>FB;;BII";
#define return {return
#define static f(x){N=(N+x)%6,y--?f(0),f(1),f(4),f(1):++Y[(I=O+N[F]-66)
#define String
#define System c
#define this if(D):1,O=I,I/=16,l<_/32?if(B):l>_/32?if(A):2,l=_,_/=16,byte
#define throws
#define toArray(x)c
#define try for(;--c.c;)
#define void /16][(_=l+N[6+F]-66)/16]?O/=16,l/=32,O<I/16?if(C):O>I/16?this
#define while(k)if(2J),if(7;21H),f(0),f(4),f(4),if(H),/*
import java.io.*;
import java.util.*;
/**
* A lame Java program.
* @author J. Random Worker
*/
class LameJavaApp
{
/** The infamous Long-Winded Signature From Hell. */
public static void main(String[] args)
throws IOException
{
/* Don't get me started on this. */
BufferedReader reader =
new BufferedReader(new FileReader(args[0]));
/* What, this long incantation just to print a string? */
System.err.println("Hello world!");
/* At least this is sane. */
String line;
while ((line = reader.readLine()) != null)
System.out.println(line.length());
}
/**
* Method with a needlessly long name.
* @param aSet a set (!)
*/
private String[] getAllStrings(Set<String> aSet)
{
/*
* This dance is needed even in J2SE 5, which has type
* templates. It was worse before that.
*/
return aSet.toArray(new String[0]);
}
}
+49
View File
@@ -0,0 +1,49 @@
#define/**/F/***/for/*A*/
#define/***/H()f=*E<<4|*\
E,f=~(f|f<<1|E[3]|E[1]|E\
[1]<<4|E[2]|E[(2)]<<(1));
#define/***/I(x,d)F(;s;C\
()){s=s^(b=s&s-1^s);F(N[\
4]=q=0;q<4;q++)N[q]=E[q]\
;N[5]=E-B;N[d]^=+b^(b)x;}
#define/**/o(p,t,i,m,a,l\
\
)u=(f&p)i(m) ;s=u&E[3];I(t(m),3)s=(u)a &E[l];I(t(m\
),l)u=u>>5-m &u;s=u&E[3-l];I(t(m),3-l) s=(u)a&*E;I\
(t(m),(0));; /*echo/Line/%d;sed/-n/-e/ %d,%dp/%s>*/
/*c.c;cc/c.c /-c*/;;char*A=0,*_,*R,*Q, D[9999],*r,l
[9999],T=42, M,V=32;long*E,k[9999],B[1 <<+21],*N=B+
1234567,q=0, h=3,j=2,O,b,f,u,s,c,a,t,e ,d;C(){F(h=N
[3];(B[h]&&+ memcmp(N,B+B[h],16));h=B[ h]+4);B[h]||
(B[h]=N-B,N= N+6);}main(char*U,int*w[] ){;;F(_=A=D+
6666,A[fread (A,1,3333,fopen(__FILE__, "r"))]=0;*++
_;h||(*_=V))
*_-59|_[1]-* _||(h&&(*_=+ 35),h---2||(_[9]=V));;F(_
=A;*_;_++)10 -*_&&*_-V&&( *_-92)&&(k[q]=isalnum(l[q
]=*_),q++);M =47;*(E=N-6) =64;E[1]=289;E[2]=270336;
F(E[3]=32782 ;E<N;E=E+6){ H()o(1048560,<<,>>,4,>>4,
1)o(+489335, >>,<<,1,,2)o (978670,<<,>>,1,>>1,2)o(+
65535,>>,<<, 4,,1)if(8192 &*E){F(N=B;E>B;E=B+E[5])*
N++=E-B;F(;N >B;){h=*(E=B +*--N);H()s=~(E[1]|h|h<<1
);u=~(E[2]|h |h<<4);r=l;_ =D;d=1;a=2;O=8;F(q=74;q;q
--){F(b=0;b< 72;b++){h=+1 <<(q-1)/14*4+(b-1)/18;j=b
?(!(b%18)&&u &h)|h&f|(!(q%14)&&s&h)?1:
0:2;if(O<3)O ?j?j-1&&(O-2 &&d--,*R=34,O=2):(*_++=O-
2?l[d]?l[d++ ]:(d=t,O=e=3 ,34):(O=1,34)):j||(*_++=d
<t?l[d++]:(O =1,d=0,34)); else{if(O<6)if(j){j-2|e||
(_=R,O-4?d-- :M-_[-1]||(_ [-1]=l[d++],O=3));c=0;if(
k[d]&k[d-1]) F(;k[d-1];++ c)d--;!d||((h=l[d])^l[d-1
])+k[d]||!(+ 40-(h&62)&&h -125)||(c=1,d--);c-1||(c=
2,d--);c&&(_ [-c]=M,_[1-c ]=T,O=4);j-2|e||(*_++=+92
);}else{h=*_ ++=O-4?O-5?l [d++]:(O=3,M):(O=5,T),(_[
-1]&&(35-h|| !(a=+1)))||( O=7,*(R=Q=_-(1))=M);}else
{j?O-7||(O=6
,_[-1]=59):( *_++=a-2?O-6 ?O-7?126&*++ r:(O=8,T):(O
=7,M):(a=0,l [d]-100?(e=1 ,O=0):(e=0,O =3,35)));if(
e==1){F(r=A= l+d;35-*A;++ A)*A-M&&*A-T ||U-1&&(*A=V
);d=d+A-r;if (U-1){*A=0;F (j=2;13499>j &&(sprintf(l
,r+1,j,j,O=j +75,w[1]),j= O,!system(l) ););exit(j<+
13499);}t=d+ 9;_[-1]=l[++ d];}a-1|+j-2 ||(R-Q<3?(*(
Q<R?R-1:R)=* Q=*R=59):(*R =M,R[-1]=T), a=2);}}j?(*_
++=j-2?V:10, R):(R=_-1);} }R[-1]=T;*R= M;*_++=10;F(
R=D;putchar( *R)&&_>++R;) ;}}};O-b-f-u -s-c-a-t-e;}
+47
View File
@@ -0,0 +1,47 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
#define X2(a) a a
#define X4(a) a a a a
#define S1(a,b,c) #a".."#b".."#c"."
#define S14(a,b,c) X4(S1(a,b,c))
#define S2(a) #a"."#a"....."
#define S24(a) X4(S2(a))
#define S4(a) #a#a#a#a
#define S3(a,b,c) S1(a,b,c)S4(..)
#define SE X4(X4(S4(..)))
char l[]=SE SE X2(S3(J,H,M)S3(J,H,E)S3(F,E,A)S3(F,E,J)S3(H,E,O)S3(H,E,C)S3(H,F,
x)S3(H,F,L)),b[]=SE X2(S4(j.jv.j.v)S4(f.fr.f.r)S4(e.eq.e.q)S4(h.ht.h.t))SE,*r[3
]={S14(v,v,q)S14(r,r,m)S14(q,q,l)S14(t,t,o),S24(J)S24(F)S24(E)S24(H),S24(M)S24(
J)S24(H)S24(L)};
#define B int
#define C double
#define S static
#define I(a,b,c,d,f,g) a=(f-d)/10.,b=1e-2*(d*(28-g)-f),c=1e-2*(d*f-8*g/3);\
d+=a,f+=b,g+=c;
S C T;typedef float A;S B D,R,U,p=0;S A F[5][0100000]={{0},{0}};
void AA(void*u,Uint8*_,B L){u=u;while(L>0){B M=p&037777,s=p>>12,u=(s%R)[
l],J=(s%U)[b],w=0,a=0,n;A v,q,m,E=(0x2000-(p&017777))/8192e0f;v=q=0;
#define EF_(x) F[w][1638##x+M
#define EF(l,s,ms) ((s*ms+EF_(4)-l]*(1-ms))/2.f+EF_(3)]/2.f)
#define FQ(s) (A)sin((0.12*pow(2,n/12.))*p*s)
#define IZ(v,c) v*=v c?v:0;
#define BF F[w][M]=F[w][M+16384]=q;v+=q;++w
#define IP(n,x,y,z,c) if(n!=46){x}q=EF(y,q,z);c;BF;
#define IS(s,c) if(q c s 0.75f)q=s 0.75f;
#define NQ(x,a,m) n=x-(x>=97?121:65)+a;q=FQ(m);
IP(u,NQ(u,12,1)m=FQ(1.01f);IZ(q,>6e-1)IZ(m,>6e-1)q+=m;q*=5e-1f*(E+1);,12288,
0.2f,;)for(;a<3;++a){char sn=(s%D)[a[r]];q=0;IP(sn,NQ(sn,12,0.25f)IZ(q,<0.3),
12288,0.2f,;)}q=0;IP(J,NQ(J,0,1/8.f)X4(q*=q;)q=(A)fmod(q*20,4)*4;,6144,0.25f,IS
(-,<)IS(+,>)q*=E)v*=0.6f;*(Sint16*)_=(Sint16)(v*32767);_++,++_,++p,--L,L--;}}
B main(B c,char**a){SDL_AudioSpec f,d;c=c,a=a;D=strlen((!!c&24)[r]),R=strlen(l)
,U=strlen(b);if(SDL_Init(16)<0)exit(1);atexit(SDL_Quit);f.freq=22050,f.format=\
AUDIO_S16,f.channels=1,f.samples=4096,f.callback=AA,f.userdata=0;if(SDL_OpenAu\
dio(&f,&d)<0)exit(2);T=0;SDL_PauseAudio(0);getchar();SDL_CloseAu\
dio();return 0;}
+14
View File
@@ -0,0 +1,14 @@
typedef unsigned char B;B*x[]={
#include "dict.h"
0};typedef struct L{B*s;struct L*n;}L;
L*h[128],*l[128],*s[128],Z[sizeof x/sizeof*x],*F=Z;int c[256],m,a=1;
int k(B*q){int g=0;B*p=q;while(*p)g|=!c[*p++]--;return g-1&p-q;}
void u(B*p){while(*p)c[*p++]++;}
void S(int N,int r,int t,L*W){L*w;int i,n;
for(n=r<N?r:N;n>0;n--)for(w=n==N?W:h[n];s[t]=w;u(w->s),w=w->n)if(k(w->s))
if(n==r){if(t==m-1)for(i=a=0;i<=t;i++)printf("%s%c",s[i]->s,i<t?' ':'\n');}
else if(t<m-1)S(n,r-n,t+1,s[t]=w);}
int main(int C,B**A){int i=0,g,n=0;B*p;while(--C)for(p=*++A;n<127&&*p;)c[*p++]++,n++;
for(;p=x[i++];u(p))if(g=k(p))(l[g]=*(l[g]?&l[g]->n:&h[g])=F++)->s=p;
while(++m<128)S(127,n,0,h[127]);
return a;}
+22
View File
@@ -0,0 +1,22 @@
;typedef char n;typedef n*m;int C;n c[11];n y[]={37,100,0};n b[2048];int i
;int A(void){return C=getchar();}int B(m s){return strlen(s)
;}n w[2048];typedef m defvar;m R(void){do A();while(isblank(C) || C == '\n')
;if(C<0) return 0;i=0;if(C==';'){for
(defvar q=
";typedef char n;typedef n*m;int C;n c[11];n y[]={37,100,0};n b[2048];int iY;int A(void){return C=getchar();}int B(m s){return strlen(s)Y;}n w[2048];typedef m defvar;m R(void){do A();while(isblank(C) || C == '\n')Y;if(C<0) return 0;i=0;if(C==';'){forY(defvar q=Y~sY;C!='\n';A()Y);R();}else if(C=='('||C==')')b[i++]=C;else if(C==34)do b[i++]=CY;while(A()!=34);else do b[i++]=C;while(!isblank(A())&&C!='\n')Y;b[i] = 0;return b;}typedef defvar*format;m E(void){Y;m a=R();if(!a) return 0;if(*a==34)return aY;if(*a=='#'){c[0]=a[2]=='N'?'\n':a[2];return c;}if(*a=='q')return wY;if(*a=='('){a=R();if(*a=='d'){R();strcpy(w,E());R();return wY;}else if(*a=='f'){R();m f = strdup(E());*strchr(f,126)=37Y;m s=E();s[B(s)+1]=0;s[B(s)]=34;printf(f+1,s);R()Y;}else if(*a=='s'){n p=*E();n o=*E();m r=strdup(E());a=r;forY(format t ;*a;a++)*a=*a==o?p:*aY;R();return r;}else if(*a=='c'){c[0]=*E()-32/*Y(substitute #\Newline (char-upcase #\y ) q= )q= );*/Y;R();return c;}else{n z=*a;int d=atoi(E()),e=atoi(E())Y;sprintf(c,y,z-'+'?z-'-'?z-'*'?d/e:d*e:d-e:d+e);R();return cY;}}return a;}int main(void){while(C+1)E();return 0;}Y"
;C!='\n';A()
);R();}else if(C=='('||C==')')b[i++]=C;else if(C==34)do b[i++]=C
;while(A()!=34);else do b[i++]=C;while(!isblank(A())&&C!='\n')
;b[i] = 0;return b;}typedef defvar*format;m E(void){
;m a=R();if(!a) return 0;if(*a==34)return a
;if(*a=='#'){c[0]=a[2]=='N'?'\n':a[2];return c;}if(*a=='q')return w
;if(*a=='('){a=R();if(*a=='d'){R();strcpy(w,E());R();return w
;}else if(*a=='f'){R();m f = strdup(E());*strchr(f,126)=37
;m s=E();s[B(s)+1]=0;s[B(s)]=34;printf(f+1,s);R()
;}else if(*a=='s'){n p=*E();n o=*E();m r=strdup(E());a=r;for
(format t ;*a;a++)*a=*a==o?p:*a
;R();return r;}else if(*a=='c'){c[0]=*E()-32/*
(substitute #\Newline (char-upcase #\y ) q= )q= );*/
;R();return c;}else{n z=*a;int d=atoi(E()),e=atoi(E())
;sprintf(c,y,z-'+'?z-'-'?z-'*'?d/e:d*e:d-e:d+e);R();return c
;}}return a;}int main(void){while(C+1)E();return 0;}
+221
View File
@@ -0,0 +1,221 @@
#define I int
#define c char *
#define G fscanf(f,
#define W while(
#define k return
#define Q if(
#define Z 512
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
FILE *f;
short w[4] = { 24, 80 };
I L, B, r, H;
c l[Z], b[Z], s[Z], S[Z][10], T[Z], h[Z];
I
e(c s)
{
I n = 0;
Q *s == '#')
k (I) strtol(s+1, 0, 0);
W n < Z) {
Q *S[n] && !strcmp(s, S[n]+1))
k *S[n];
n++;
}
k '?';
}
void
P(I x)
{
Q x == '\n' || w[1] - 3 < B) {
b[B] = 0;
b[B+1] = 0;
B = printf("%s", b);
B = snprintf(
b, Z,
"\n %s",
b + B + 1
);
r++;
}
Q b[B-1] != ' ' || !isspace(x)) {
b[B++] = isspace(x) ? ' ' : x;
Q w[1] - 3 < B)
*strrchr(b, ' ') = 0;
}
}
void
p(c t, ...)
{
va_list x;
va_start(x, t);
vsnprintf(s, Z, t, x);
t = s;
W *t)
P(*t++);
va_end(x);
}
I
X(c s)
{
I x;
c t = s;
long m = ftell(f);
W *t && (x = fgetc(f)) != EOF) {
Q *t == '*')
s = t++;
Q tolower(x) != *t) {
Q *s != '*')
break;
t = s;
}
t++;
}
Q *t)
fseek(f, m, SEEK_SET);
k !*t;
}
void
d(c s)
{
Q 4 < B)
P('\n');
P('\n');
Q *s == 'h')
B = 1;
}
void
a(c s)
{
*T = 0;
G
ungetc(fgetc(f), f) == '"'
? "\"%511[^\"]"
: "'%511[^']",
T
);
Q *s == 'a' || *s == 'f' || s[1] == 'f') {
free(l[++L]);
l[L] = strdup(T);
p(" [%d] ", L);
}
Q *s != 'a')
p("%s%s\n", T, *s == 'b' || s[1] == 'h' ? "" : "\n");
X("*>");
}
void *Y[] = {
"!--*-->" , 0 ,
"a *href=" , a ,
"ifr*src=" , a ,
"fra*src=" , a ,
"img*src=" , a ,
"p*>" , d ,
"bl*>" , d ,
"br" , a ,
"hr" , a ,
"h*>" , d ,
"/h" , a ,
"/tr" , a ,
"/dt" , a ,
"/dd" , a ,
"li*>" , d ,
"*>" , 0 ,
0 , 0
};
I
main(I V, c *v)
{
I x, n = 0;
c t = v[1];
ioctl(0, TIOCGWINSZ, w);
f = fopen("entities.txt", "r");
Q f) {
W G "%s %d", S[n]+1, &x) == 2)
*S[n++] = x;
fclose(f);
n = 0;
}
W t) {
I m = 0;
struct hostent *y;
struct sockaddr_in A;
L = 0;
B = 1;
Q !sscanf(t, "http://%255[^/]%n", h, &n) && !*h) {
Q !(f = fopen(t, "rb")))
k 1;
goto e;
}
Q 0 < sscanf(h, "%*[^:]%n:%d", &x, &H))
h[x] = 0;
else
H = 80;
y = gethostbyname(h);
Q !y)
k 1;
memcpy(&A.sin_addr.s_addr, y->h_addr, y->h_length);
A.sin_port = htons( (short) H);
A.sin_family = y->h_addrtype;
f = tmpfile();
Q !f)
k 1;
W
connect(
m = socket(
A.sin_family, SOCK_STREAM, 0
), (void *) &A, sizeof A
)
|| errno == EINTR
)
;
n = snprintf(
b, Z,
"GET %s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n",
t[n] == '/' ? "" : "/", t+n, h, H
);
Q send(m, b, n, 0) == n) {
W 0 < (n = recv(m, b, Z, 0)))
fwrite(b, 1, n, f);
}
close(m);
rewind(f);
X("*\r\n\r\n");
e:
r = 3;
*b = ' ';
W r < *w && (x = fgetc(f)) != EOF) {
Q x == '<') {
void **p = Y;
W *p) {
Q X(*p)) {
Q p[1])
(* (void (*)(c ))
p[1])(*p);
break;
}
p += 2;
}
} else {
Q x == '&') {
G "%9[^;];", T);
x = e(T);
}
P(isspace(x) ? ' ' : x);
}
}
printf("\n? ");
fflush(stdout);
fgets(T, Z, stdin);
Q *T == '\n')
goto e;
t = l[strtol(T, 0, 0)];
fclose(f);
}
k 0;
}
+138
View File
@@ -0,0 +1,138 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define H 20
#define X for
#define F(v,b) X(k = 0; k < 3; k++) v[k] = b;
typedef double R, V[3], U[4], (*J)(R);
typedef void Z;
typedef int _;
V o, d, v;
R (*q)[H][6], C[4*H][H][6], sr = 15, br = 25, A, s, t;
_ P, Q, g, S, k, e = 256, (*u)(_) = putchar, D[64];
J f = cos, Y = sin;
char B[256];
Z
T(_ *p, _ k, _ n)
{
_ g;
*p = n;
X(g = 0; k && g < 4; g++)
T(p + (9 & (g * 4|g))*(1<<k - 1), k - 1,
n + (1<<6-2 * k)*(4 - g&3));
}
Z
O(_ c)
{
B[++S] = c,
(S > e-2 || c==129) && (*B = S, S = fwrite(B, S+1, 1, stdout) - 1);
}
Z N
(R*v){R w=sqrt
(*v**v +1[v]*v[1]
+v[2]*2[v]);F(v,v[k]
/w)}Z K(_ j){V
n,p ;R*b=(*
q) [j],w=f
(A),x=
Y(A);
F(p,
br*o[
k]+sr
* (n[ k] =f(t)*k[v]+
Y(t)*(v[(k+1)%3]* d[( k+2)%3]-v[(k+2)%
3]*d[(k+1)%3])))*b++=p[1 ]+e/ 2,*b++=-*p*x+
p[2]*w-e*e,*b++=(*p*w+p[2]*x)+e/2;F( b,fabs(*n
*!!k+n[1]*( k<2)+n[2])/sqrt(2+ !(k-1)))
}Z M(R*a,_ s,Z(*m)(_)){_ i;R d=
pow(25/log (36),4)/s/ 377;X(
*a=i=0;i<s ;i++,*a+=d )m(i);
}Z G(_ i ){R w=-Y (P*s),
x=f(P*s), y=Y(Q*s ),z=f
(Q*s);F( v,k[o] =(k<2
)*(x+3)*( k?y:z) -!(k-2 )*w)N(
v);F(d,P* (k?k- 1?x:w*y:w*z )+Q*(k?
k-1?0:*o:- o[1]) )N(d),w=*d**v+d[1]
*v[1]+d[2] *v[2 ];F(v,k[v]-w
*d[k])N(v),q =&C[
i],M(&t,H,K); }Z W
(char*s){*s&&( W(s
+1),u(*s-98*(*s>
97)));}Z E(_ z){R
*r,*a,*b;U*q,l,x,d
,I[256];_ i,j,m,c,y,
w,h,Y=sizeof l;fputc(
46,stderr),M(&s,4*H,G),
W("ibcbcbbbbb,"),g=130,
O(e/2);X(y=0;y<e;y++){X(i
=e;i;)*(I[--i])=0;X(;i<4
*H*H;i++)X(*l=k=0;k-5;k++
,a=b)if(b=C[(i/H+((k^k/
2)&1))%(4*H)][(i+(k/2&1
))%H],k&&y<*a^y<*b){X(
h=0;h<4;h++)h[x]=a[h
+2]+(b[h+2]-a[h+2])
*(y-*a)/(*b-*a),h?
*l&&(d[h]=(l[h]
-h [x])/w):(w=1+
fabs (*l-(*x=(_)*x)
) ); X(q=I+(_)*x;
*l&& w--;q+=2*(
*x<* l)-1)X(**q
>C[i /H][i%H][1
]&&( memcpy(*q,
x,Y),* *q=C[i/H][
i%H][1 ]),h=1;h<
4;h++)x [h]+=h[d];
memcpy(l ,x,Y);}X(
i=0;i<e;i++ ,O(*r?c:
127),g=g<e-1 ?g+1:(O(e/
2),130))X(r=&I[ i][3],c=0,j
=2;j+1;j--,r--)k=3|!( j-1)*4,m=*r*k+
(63*( *r*k-(_)(*r*k))>D[(y*8&56)+(i&7)
]), c<<=k/4+2,c|=(m|-(m>k))&
k;} O(129);u(0);}_
main(_ c, char **v)
{
if (c < 3)
return fprintf(stderr, "Usage: %s P Q [F]\n", *v), 1;
P = atoi(v[1]),
Q = atoi(v[2]),
T(D, 3, 0);
W("bb\346cbcba98FIG");
X(; k < 384; k++)
u(k / 3<<("gdb"[k%3] - 97) | 31 | (k % 3!=1)<<5);
W("bbbce0.2EPACSTEN\x0b\xff!"),
M(&A, c > 3 ? atoi(v[3]) : 40, E),
u(59);
return 0;
}
/* vi:set ts=8: */
+66
View File
@@ -0,0 +1,66 @@
#include <stdio.h>
#include <string.h>
#include <curses.h>
#define P *p
#define E (s?s-1?s-2?
#define T (s=fgetc(g))
#define _ m[n&
#define L R(
#define b ):L
#define G ):(
#define r =t&
#define F _++k+O]
#define W t--?t--?
#define Y _ k--+O]=
#define M W W W W W W W
#define J *E &D:&V:&I:&C)
#define q C|Z|I|D|B|V|S|32
#define H E Z:C:V:S)&&(d+=P&l?P-O:P)
#define U(z,w)(t=w,d+=z,_ t]+_ t+1]*O)
int d,C,Z,I,D,B,V,S,i=49152
,t,s,o,h,z,O=256,n=65535,l=128,f=255,e,w; unsigned char*p,m[65536],a,x,y,k,*u,
*j=" ./ p/ 7 ] . 6 6 p t7 r(0)1*+2,4WgcovGn^f_NVO>F?T\\swldiHZYI9QJ"
"RCKSL[b<D8AP:;a@`BXq3j=- HZYI9QJRCKSL[b<D8AP:;a@`BX 57 ; ; ; ; "
" ; "
" )< <% ><% <% '< <% +< <% 7$ ($A @$A "
"($A &$ $A *$ $A C2 2; =2; 62; '2 2; +2 2; D# #B ?#B 6#B &# #B "
"*# #B F HFG 1 L HFG 'F HFG NFM F :89 :89 J8I :89 &8 :89 +8K :89 ., "
".,/ 5,0 .,/ ', ,/ +, ,/ -E -E3 4E -E3 &E E3 *E E3 2133024425660788"
; R(x){ Z=x?0:2; S=x&l; } K(x){ R(x-P); C=x<P?0:1; } A(){ R(t=F); C r 1; Z r 2
; I r 4; D r 8; B r 16; V r 64; } X( ){ Y d/O; Y d; } N( ){ X( ); Y q; I=4; d=
U(0,n-1); } main(int c,char*v[])
{ FILE*g ; _ z]=time(0); g=fopen(
c>1?v[1]:"", j+32); t=i; if(g) { ;
for(; T+1;
_ t++ ]=s);
w r /* ### COMMODORE BASIC ### */n ;
d=w?i: U(C, n
-3); /* READY. */z=c>
2?atoi( v[2])+1
:4; c=z ? n * z
/ 4 : n; nodelay(
initscr( ), 1 ) ;
curs_set(I); cbreak(); noecho( ) ; for (; ;
) { o++ % ( c *4) ?h :( h= getch () ,h-ERR?(_
162]=h|l):0); if(!w){ s=(_ 59408]
|=z?l:0)&15; _ 59410]=~(h-ERR?(s^8?0:j[h|l]&1)|(j[h]/8
-5-s?0:1<<j[h]%8):0); } o%c|I||N(); p=m +O+O+ _ l-9]; t
=d%65493; i=_ d++]; if(w+t<4){ if(P&&(u=strchr(++p,34)))
{ *u=0; _ l-9]=u-m+1; if(g=fopen(p,t?j+61:j+32)){ i=1025
-t; if(!t){ T; for(T; T+1; _ i++]=s); for(p=m+42; p<m+47 ;
){ P++=i%O; P++=i/O; } } for(; t; fputc(_ i],g))t=_++i]?3:t
-1; fclose(g); } } i=96; } t=j[i/2&14|i&1|O+O]&15; e=W W W W
U(2,d)+(i-190?x:y):U(2,d)+y:f&_ d++]+(i-150&&i-182?x:y):U(1,_ d
])+y:U(2,d):_ d++]:d++:U(1, _ d ] + x & f ):&a - m; p=e
+m; s=i>>6; t=j[i+O]-35; M M M W 0 : L a = y G k = x G L
a=x)G L x = k ) G L y=a)G L x = a ) G P =y G P = x G P
=a G t=a-P-1+C,C r O?0:1,V=((a^ P ) & ( a ^ t )&l)/2 , L a r
f)G d=F+F*O+1 G A(),d=F+F*O G t=P,L P=P/2|C*l),C r 1 G t=P,L P=P*2|C),C=t
/l):A(b a=F G Y q G Y a G L a|=P)G C=P&1,L P/=2)G L y=P)b x=P b a=P G s=U(1
,--d),X(),d=s G d=i&32?U(0,e):e b++y b++x b++P b a^=P b--y b--x b--P):K(y):
K(x):K(a G J=0 G J=E 8:8:4:1)G d--,B=16,N() G L a&P),V=P&64,S=P&
l):!H:H:(C=P/l,L P*=2)b a&=P G t=a+P+C,C r O?1:0,V=(~(a^P)&(a^t)
&l)/2, L a r f)); t=e^O*O/2; if (t<1000) { s=P%l; i=A_REVERSE; P>s ? attron(i)
:attroff(i); mvaddch(t/40,t%40,s+w<32?s+64:s>95+w?s-32:s); } } } perror(*v); }
+26
View File
@@ -0,0 +1,26 @@
#include <stdio.h>
#define _ main(
#define _l ___l ___l ___l ___l ___)
#define __l int
#define ___l ___)*(
#define ____l (_l],
#define ____ 1
#define ___ __+_____
#define __ ____+____
#define _____ __+____
#define ______1 *(l__
#define _____1 *__1%(__
#define ____1 )?(
#define ___1 _1&(__
__l __I[____l _I[____l*l__=_I,*l_=__I;__l _ __l _1,__l*__1){__l _l_;
return ___1+ __ ____1 ___1 ____1*__1 = getchar()):__ ____1*__1<____?
____:_____1+___ ____1 _____1+_____ ____1 _____1+____)____1 ___1+___+
____ ____1 _____1 +__)____1 _____1 )____1 *l__)++:_____1+____)-____?
______1 ++) :_____1+_____) -____?__:printf("%d\n",*l__):_____1+____+
___ ____1 *l__) =*(l_++ ):__:___l ____- ____):_____1 +_____)-3?__-2:
____:(___1+____+___ ____1 _____1)____1*l__)-- :_____1+__)?__:______1
--):___l 0))?__:_ _1,__1+____)+____:(___1+____+___ )) &&* l__?_ ___1
+___+___+__),__1+____)?_ ___1+11 )|(___1)?____:__- 2),__1):____-1 :(
_l_=_ ___1 -____+___l ____),__1+____ )) ?_l_+_ ___1 )?_1 :___1+10)|(
___1-____ ____1 __):0),__1+_l_):0):__:_1%(__ ____1 _1/(__)) ?_ scanf
("%i",__1 ____1 _____):(___l _____)-____,__1 +____):_ _____,l_):__;}
+64
View File
@@ -0,0 +1,64 @@
#define F getchar())
#define H(z)*n++=z;
#include <setjmp.h>
#define v main(0,0,0
#define Z while(
#define _ if(
#define o(d) (u[l]=0,l[d]=6^e,q=1e4>v,0),l[d]=0,u[l]=e^6,q)
#define I(H,n) { _ r=l[x=H],!r|(r^e)<-1){ _ j=u[l],-7==r|6==r\
){ n; e=~e; return 1e5- f; } u[l]=0,t=j+1,i=j-1; _!i&89<x)i\
=j,t=6; _-1==t&30>x)t=j,i=-7; Z++i<t){ b=S; d=0; S&=63; \
a=((j^e)!=1?6!=(j^e)?O[32+x/10]-O[u/10+32]-q:(S|=6!=j?8\
:1,2==u-x)*9+9*(x-u==2):(d=1==j?x-u:u-x)/8+!(!((x-u)%\
10)|r)*99+(j==1?90<x:29>x)*(9*O[28+i]-288))+O[r+28\
]*9-288+O[x%10+33]-f-O[33+u%10]; x[l]=i; S|=(21=\
=u|21==x)*2+(u==28|28==x)*4+(91==u|x==91)*16+32\
*(u==98|x==98)+(20==d)*64*x; a-=k>f?main(a,f+1\
,M,k):0; _ i==c&u==h&!f&N&a>-1e4&x==y)longjm\
p(z,1); S=b; _!N|f&&(a>M||!f&a==M&&1&rand()\
)){ _!f){ _ k){ c=i; h=u; y=x; } } else _ \
L-a<N){ n; e=~e; u[l]=j; x[l]=r; return\
a; } M=a; } } x[l]=r; u[l]=j; n; } }
typedef int G; char J [ 78 ], O [ ]
= "HRQAMS#-smaqrh[UTZYTU[|TBA("
"$#(ABT|ba`gg`ab8>GK[_`fFDZXEYR" "L\t####"
"##B#A#@#G#F#E#D#K\t\3Zlv#tjm" "\3J#tjm\3Pwb"
"ofnbwf\3Joofdbo\3)&`&`.&`&`" "#+&g*\t"; G y,
c,h,e,S,*s,l[149]; jmp_buf z ; G main(G L,G f,
G N,G k){ G u=99,p,q,r,j,i,x ,t, a, b,d,M=-1e9
; char *n; if( *l){ e=~e; Z u >21){ q= l[--u]^e;
_!-- q){ _!l[p=e?u-10:u+10]){ I(p,)_ e?u>80 & !l[p
-=10]:u<39&!l[p+=10])I(p,)} _ l[p=e?u-11:9+u] )I(p,)
else _ u-1==S>>6){ l[u-1]=0; I(p,l[u-1]=-2^e); } _ l[
p=e?u-9:11+u])I(p,)else _ S>>6==1+u){ l[1+u]=0; I(p,l
[1+u]=e^-2); } } _!--q){ n=O+41; Z++n<50+O)I(u+80-*n,
)} _ 0<q&4>q){ n=q==2?53+O:O+49; Z++n<O+(q!=1)*4+54
){ p=u; do I(p-=*n-80,)Z!p[l]); } } _ 4==q){ n=49+O
; Z++n<O+58)I(u-*n+80,)_ e&!(S&24)|!e&!(S&3)&&k&&
!l[u-2]&!l[u-1]&!l[u-3]&&o(u)&o(u-1)){ l[u-1]= 4
^e; l[u-4]=0; I(u-2,l[u-1]=0; l[u-4]=e^4); } _
e&!(S&40)|!e&!(S&5)&&k&&!l[u+1]&!l[2+u]&&o(u)&
o(1+u)){ l[u+1]=e^4; l[3+u]=0; I(u+2,l[1+u
]=0; l[u+3]=4^e); } } } e=~e; return M; }
Z h<130){l[h]=-(21>h|98<h|2 >(h+1 )%
10); O[h++]^=3; } n=O +14; s=20+l; Z
++s<29+l){ 10[s]=1; 70[s]=~ ( * s = *
n++ -+84); 60 [ s] =-2; } Z n=J){ puts
(58+O); u=19; Z++u<100){ H(32)_!( u%10
))H(32)H(O[7+l[u]])_(9+u)%10>7){ H(58
-u/10)H(32)_ u&1)puts(n=J); } } puts
(O+58); _-1e4 >v , 1)){ e=~e; puts
(O+(v,0)> 1e4?e?90:82:96)); break
; } _ 1<L&e) { d=v,2+L); printf
(O+114,h%10+64,58-h/10,y%10+64
,58 -y/10,d); } else{ putchar
(62 ) ; h= (95 & F-44; c=l[h
+=(56-F *10]; y=(95&F-44; y
+=(56-F*10; Z 10!=(u=(95
&F)){ c=5; Z--c>1&&u!=c
[O]); c=e^c-7; } } _!
setjmp(z)){ v+1,1);
puts( 106+
O); } } Z
10!=
F; }
+109
View File
@@ -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;
}
+90
View File
@@ -0,0 +1,90 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <GL/glx.h>
#include <GL/glu.h>
#define E(x) { printf("%i\n",x); goto l; }
#define G fgetc(F)
#define H glEnable(
#define I glMaterialfv(GL_FRONT,
#define J glMatrixMode(
#define L (y
#define M 640,480
#define N NULL
#define O GL_DIFFUSE , i
#define P glCallList(u);
#define T glTexCoord2i
#define U glLightfv(GL_LIGHT0,
#define V R(); glVertex3i(c,m,n);
#define X GL_TEXTURE_2D
#define Z(x) G; x=G; x=x<50-(x==59);
void Y()
{ { { { { { { { { { { { { { { {
{ { { { { { { { { { {
{ { { { { {
{ { { { { { { {
{ { { { { {
{ { { { { ; { } } } } }
} } } } } } }
} } } } } }
} } } } } }
} } } } } }
} } } } } } }
} } } } } } } } } } } } } } } }
void Q()
{ { ; { { { { { { { {
{ { { { { {
{ { { { { {
; { { } } } } } } } }
} ; } } } } } } } } }
} } } } } }
FILE *F; int u,t,l,m,n,x=0,a=0,b[]={ GLX_DOUBLEBUFFER,
GLX_RGBA , GLX_DEPTH_SIZE , 16, None},o,n,c ; void R() {
Z(c); Z(m); Z(n); } int main( int _, char **A) { char f[
BUFSIZ ] ; GLXContext r ; XVisualInfo * v ; Display *y;
XEvent e ; GLfloat g=0, h=10, i[ ]= { 1,1, 1, 1, 5,5, 100
,0, .6, .6, .6 ,1 } ; XSetWindowAttributes s; GLubyte j[1
<<10] ; Window w; if(! L= XOpenDisplay ( N ) ) ) E(1) ;if
( !
glXQueryExtension L , N , N ) ) E (2); v=glXChooseVisual L ,
DefaultScreen (y ) , b ) ; s.colormap = XCreateColormap L ,
RootWindow (y,v -> screen), v -> visual, AllocNone ); if (!(
r= glXCreateContext L, v, N, 1) ) ) E (3) ; strcpy(f, *A ) ;
s.event_mask=KeyPressMask; strcat(f,".c"); F=fopen(f,"r" ) ;
w= XCreateWindow L, RootWindow( y, v -> screen ), M , M, 0,v
->depth,InputOutput, v->visual , CWColormap|CWEventMask, &s)
;glXMakeCurrent L , w , r ); H GL_DEPTH_TEST ); if ( ! F )E(
4 ) ; glShadeModel ( GL_SMOOTH ) ; while ( a != 89 ) a = G ;
G; G ; glGenTextures( 1, & t ); while ( x< 1024 ) { G; a =G;
j[ x++ ] = 128; j[ x++ ] = 128 & - ( a<33 ); j [ x ]= j[ x-1
]; x++; j[x++] =-1;} glBindTexture(X,t); glTexParameteri (X,
GL_TEXTURE_MIN_FILTER , GL_NEAREST ) ; glTexImage2D( X ,0,
GL_RGBA, 16 , 16 , 0 , GL_RGBA, GL_UNSIGNED_BYTE , j ) ; J
GL_PROJECTION ) ; gluPerspective( 60 , 1.333 , 1 , 100) ; J
GL_MODELVIEW); u=glGenLists(1); glNewList(u,GL_COMPILE); H X
) ; while ( a != 81 ) a = G ; G ; G ; for (x=0; x<6; x++ ) {
glBegin(GL_QUADS); R(); glNormal3f( c, m,n); T(1,1); V T (1,
0 ) ; V T ( 0 , 0 ) ; V T( 0 , 1 ) ; V glEnd ( ) ; }
glEndList( ) ; XMapWindow L , w ) ; c = 0; for ( ; ; ) { if(
XPending L ) ) { XNextEvent L , &e ) ; if((XLookupKeysym ( (
XKeyEvent *)&e,0))&1<<5){ h=10; i[c]=!i[c]; c++; c&=3; } else
E(0)} glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ;
glLoadIdentity(); gluLookAt ( -2 ,0 ,5 ,0,0 ,0,0 ,0 ,1 ) ; H
GL_LIGHTING); H GL_LIGHT0 ); U GL_POSITION, i + 4); U O) ; U
GL_SPECULAR,i); glLightModelfv( GL_LIGHT_MODEL_AMBIENT,i +8)
; I GL_AMBIENT, i+8); I O + 8 ) ; glRotatef( g, 1, 1, 1) ; P
glTranslatef(-h,0,0); P usleep (4000); g+=.07*x; if (g>360)
g-=360.0; h-=x /100.0; glFlush(); glXSwapBuffers L ,w);}
l:
return 0;
}