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:
1 parent
cfd253683f
commit
2ba12ecc3c
320 files changed
+21365
No files matched your search
@@ -0,0 +1,307 @@
|
||||
#define D ++*p
|
||||
#define B **p
|
||||
#define W while
|
||||
#define R return
|
||||
#define E else
|
||||
#define Q if
|
||||
#define G fprintf(stderr,
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifndef A
|
||||
#define A 512
|
||||
#endif
|
||||
|
||||
typedef int I;
|
||||
typedef char C;
|
||||
typedef void V;
|
||||
|
||||
I z;
|
||||
I f;
|
||||
I x;
|
||||
I a[A], b;
|
||||
|
||||
|
||||
I d[A][A];
|
||||
I m[A], n, o;
|
||||
|
||||
I N();
|
||||
I M();
|
||||
I P();
|
||||
I U();
|
||||
V X();
|
||||
V T();
|
||||
V F();
|
||||
V L();
|
||||
V O();
|
||||
|
||||
I
|
||||
main(c, p)
|
||||
I c;
|
||||
C B;
|
||||
{
|
||||
I i;
|
||||
FILE *j;
|
||||
C *k, l[BUFSIZ+1];
|
||||
|
||||
Q (--c < 1) {
|
||||
G "usage: ag <pattern> [js...]\n");
|
||||
R 2;
|
||||
}
|
||||
|
||||
|
||||
N(-3);
|
||||
N(-6-b);
|
||||
N(0);
|
||||
N(-3-b);
|
||||
|
||||
X(&(*++p));
|
||||
|
||||
*l = '\n';
|
||||
o = 1;
|
||||
i = 1;
|
||||
do {
|
||||
k = "-";
|
||||
j = stdin;
|
||||
Q (1 < c && **++p != '-') {
|
||||
Q (!(j = fopen(k = *p, "r"))) {
|
||||
G
|
||||
"ag: Failed to open '%s'.\n", k);
|
||||
i = 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
W (fgets(l+1, BUFSIZ, j)) {
|
||||
Q (M(l)) {
|
||||
printf("%s:%s", k, l+1);
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
fclose(j);
|
||||
} W (1 < --c);
|
||||
R i;
|
||||
}
|
||||
|
||||
|
||||
V
|
||||
X(p)
|
||||
C B;
|
||||
{
|
||||
I i, j;
|
||||
i = N(-3);
|
||||
T(p);
|
||||
W (B == '|') {
|
||||
D;
|
||||
j = N(-3);
|
||||
N('\n');
|
||||
a[i] = -4-b;
|
||||
i = N(-3);
|
||||
T(p);
|
||||
a[j] = -4-b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
V
|
||||
T(p)
|
||||
C B;
|
||||
{
|
||||
W (B != '|' && (!x || B != ')') && B)
|
||||
F(p);
|
||||
}
|
||||
|
||||
|
||||
V
|
||||
F(p)
|
||||
C B;
|
||||
{
|
||||
I i = N(-3);
|
||||
Q (B == '^') {
|
||||
D;
|
||||
N('\n');
|
||||
} E Q (B == '$') {
|
||||
D;
|
||||
N('\n');
|
||||
} E Q (B == '(') {
|
||||
D;
|
||||
++x;
|
||||
X(p);
|
||||
Q (B != ')') {
|
||||
G "ag: Missing ')'.\n");
|
||||
exit(3);
|
||||
}
|
||||
--x;
|
||||
D;
|
||||
} E {
|
||||
L(p);
|
||||
}
|
||||
Q (B == '*') {
|
||||
D;
|
||||
a[i] = -4-b;
|
||||
N(-5-i);
|
||||
} E Q (B == '?') {
|
||||
D;
|
||||
a[i] = -4-b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
V
|
||||
L(p)
|
||||
C B;
|
||||
{
|
||||
I i, j;
|
||||
Q (B == '.') {
|
||||
N(0);
|
||||
} E Q (B == '[') {
|
||||
D;
|
||||
i = N(-2);
|
||||
Q (B == '^') {
|
||||
D;
|
||||
a[i] = -1;
|
||||
}
|
||||
Q (B == ']') {
|
||||
D;
|
||||
N(']');
|
||||
}
|
||||
W ((i = B) != ']') {
|
||||
Q ((*p)[1] == '-' && i < (j = (*p)[2])) {
|
||||
W (i <= j)
|
||||
N(i++);
|
||||
*p += 3;
|
||||
} E {
|
||||
N(i);
|
||||
D;
|
||||
}
|
||||
}
|
||||
N('\n');
|
||||
} E {
|
||||
Q (B == '\\')
|
||||
D;
|
||||
N(B);
|
||||
}
|
||||
D;
|
||||
}
|
||||
|
||||
|
||||
I
|
||||
N(c)
|
||||
I c;
|
||||
{
|
||||
Q (A <= b) {
|
||||
G "ag: Pattern too long.\n");
|
||||
exit(3);
|
||||
}
|
||||
a[b] = c;
|
||||
R b++;
|
||||
}
|
||||
|
||||
|
||||
V
|
||||
O(p)
|
||||
I p;
|
||||
{
|
||||
I i = n;
|
||||
Q (b <= p)
|
||||
R;
|
||||
Q (a[p] < -2) {
|
||||
Q (a[p] != -3)
|
||||
O(-4-a[p]);
|
||||
O(p+1);
|
||||
} E Q (!a[p] || a[p] == z || P(&p)) {
|
||||
|
||||
W (i < o)
|
||||
Q (m[i++] == p)
|
||||
R;
|
||||
|
||||
f = U(p+1);
|
||||
|
||||
Q (A <= o) {
|
||||
G "ag: Out of space.\n");
|
||||
exit(3);
|
||||
}
|
||||
|
||||
m[o++] = p;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
I
|
||||
P(p)
|
||||
I *p;
|
||||
{
|
||||
I i = 0, j = 0;
|
||||
Q (a[*p] == -2 || (j = a[*p] == -1)) {
|
||||
W (a[D] != '\n')
|
||||
Q (a[*p] == z)
|
||||
i = 1;
|
||||
}
|
||||
R i ^ j;
|
||||
}
|
||||
|
||||
|
||||
I
|
||||
U(p)
|
||||
I p;
|
||||
{
|
||||
R (
|
||||
f || p == b || (
|
||||
a[p] < -2 && (
|
||||
(a[p] != -3 && U(-4-a[p]))
|
||||
|| U(p+1)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
I
|
||||
M(p)
|
||||
C *p;
|
||||
{
|
||||
I c, i, j, k;
|
||||
f = c = 0;
|
||||
W (*p && 0 <= c) {
|
||||
Q (0 < (i = d[c][*p])) {
|
||||
|
||||
c = i;
|
||||
} E {
|
||||
|
||||
z = *p;
|
||||
i = d[c][0];
|
||||
j = n = o;
|
||||
do
|
||||
O(m[i++]+1);
|
||||
W (m[i] != 2);
|
||||
|
||||
|
||||
i = k = 0;
|
||||
W (i < n) {
|
||||
Q (m[i] == 2) {
|
||||
j = n;
|
||||
++k;
|
||||
}
|
||||
Q (m[i++] == m[j]) {
|
||||
Q (o <= ++j) {
|
||||
j = n;
|
||||
Q (m[i] == 2) {
|
||||
|
||||
o = n;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} E {
|
||||
j = n;
|
||||
}
|
||||
}
|
||||
Q (n < o)
|
||||
|
||||
d[++k][0] = n;
|
||||
c = d[c][*p] = f ? -1 : k;
|
||||
}
|
||||
++p;
|
||||
}
|
||||
R c < 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
long
|
||||
z[7992],W,H,*t=z,j,k,*T=z,n,b;
|
||||
#include<X11/Xlib.h>
|
||||
Window*E,D,s,w[999],*e=w;
|
||||
Display*d;
|
||||
Pixmap
|
||||
p;
|
||||
m(w,h,x,y,u,v){
|
||||
#define C XCreateSimpleWindow(d,
|
||||
XSetWindowBackgroundPixmap(d,s=C*e=C
|
||||
#define l(n)t[n]=T[n]+
|
||||
D,l(0)x,l(1)y,t[2]=w,t[3]=h,1,b,0),l(6)-x,l(7)-y,W,H,0,0,0),p);
|
||||
l(4)u;
|
||||
l(5)v;
|
||||
#define M XMapRaised(d,
|
||||
M
|
||||
s);
|
||||
M*e++);
|
||||
t+=8;
|
||||
}
|
||||
main(c,g)char**g;
|
||||
{
|
||||
XSetWindowAttributes
|
||||
a;
|
||||
XGCValues
|
||||
v;
|
||||
n=DefaultScreen(d=XOpenDisplay(0));
|
||||
p=XCreatePixmap(d,D=RootWindow(d,n),W=DisplayWidth(d,n),H=DisplayHeight(d,n),DefaultDepth(d,n));
|
||||
v.subwindow_mode=IncludeInferiors;
|
||||
XCopyArea(d,D,p,XCreateGC(d,D,GCSubwindowMode,&v),0,0,W,H,0,0);
|
||||
a.override_redirect=True;
|
||||
XChangeWindowAttributes(d,D=C
|
||||
D,0,0,W,H,0,0,b=BlackPixel(d,n)),CWOverrideRedirect,&a);
|
||||
M
|
||||
D);
|
||||
m(W,H,0,0,3,3);
|
||||
for(c=c^1?atoi(g[1]):9;
|
||||
;
|
||||
)for(T=z,n=e-(E=w);
|
||||
n--;
|
||||
T+=8,++E){
|
||||
XMoveWindow(d,*E,*T+=T[4]*c,T[1]+=T[5]*c);
|
||||
j=0;
|
||||
#define F(n,o,s)o+T[n-4]s-0&&++j&&T[n]s!1&&(T[n]=0-T[n])||
|
||||
if((F(4,0,<)F(4,T[2]-W,>)F(5,0,<)F(5,T[3]-H,>)1)&&j&&(j=T[2]/2)&&(k=T[3]/2)&&e-w<997&&rand()%32768<=T[2]*T[3]*(T[4]*T[4]+T[5]*T[5])/999){
|
||||
m(T[2]-j,T[3]-k,j,k,2,2);
|
||||
m(j,T[3]-k,0,k,-2,-2);
|
||||
m(T[2]-j,k,j,0,2,-2);
|
||||
T[7]-=2;
|
||||
XResizeWindow(d,*E,T[2]=j,T[3]=k);
|
||||
T[6]-=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#define maxc (prs >> 16)
|
||||
#define maxr (prs & 0xff00) >> 8
|
||||
#define find (col > 1)
|
||||
#define endb || (prs & 16) && X(0) || chpa || (eols, 0)
|
||||
#define lnst doln ? 0 : (init, 0) || (prs & 128) && X(0)
|
||||
#define L endb) || 0 || (find ? 0 : (rrr++, rrc = 0)) || (lnst
|
||||
#define X(p) (dfc++ && ((prs & 48) != 32 || rrc < maxc) && ++ccl && \
|
||||
(find ? (bat = bit, bit = but, but = p, ccl == col && \
|
||||
(ret = bat + bit + but) + 1) : (las = las * 2 + \
|
||||
(((main(ccl + 1, cro - 1) + main(ccl + 1, cro) + \
|
||||
main(ccl + 1, cro + 1) - p) | p) == 3), occ |= las & 1, \
|
||||
printf(" %c", "_O"[las & 1]), ccl == 2 && (sta |= (las & 3) << 6),\
|
||||
0)))
|
||||
#define _ || (find || rrc++, 0) || X(0)
|
||||
#define O || (find || rrc++, 0) || X(1)
|
||||
#define chpa (find && col > ccl && ((ret = bit + but) + 1))
|
||||
#define eols (!find && (cro == 1 ? (sta |= occ << 3) : cro == 2 && \
|
||||
(sta |= occ << 2), sta |= (las & 3) << 4))
|
||||
#define init (find ? (ret = bit = but = 0) : (ocp = occ, las = occ = 0, \
|
||||
printf("\nL")), dfc = (prs & 192) != 64, ccl = 0)
|
||||
#define doln !(dfl++ && (((prs & 3) != 2) || rrr < maxr) && \
|
||||
(++cro == row || !find))
|
||||
#define recu (col =- col, (ccl = find ? rcf : rcl), cro = rro, 0 _ || \
|
||||
(rrc >= maxc ? 0 : (find ? rcf = ccl : (rcl = ccl), \
|
||||
main(-col, row))))
|
||||
#define addl (lnst || (rro = cro, find ? rcf = ccl : (rrc = 0, rcl = ccl), \
|
||||
0) || main(-col, row) || (ccl = rcl + 1, 0) endb)
|
||||
#define outp (find || printf("\n\nGEN %d STAT %ld\nEND\n", ++gen, \
|
||||
(long)ccl << 16 | cro << 8 | (sta | occ | ocp << 1) ^ 0x66))
|
||||
#define GEN endb) || (prs & 1) && addl || (outp, 0)), ret)); } int gen =
|
||||
#define STAT ;long prs =
|
||||
#define END ;
|
||||
#define LIFE int bat, bit, but, las, gen, ret, rcl, rcf, rro, rrc, rrr, \
|
||||
occ, ocp, sta, dfc; long prs; main(int col, int row) { \
|
||||
int dfl = ((prs & 12) != 4), ccl = 0, cro = 0; return \
|
||||
col == 1 && printf("LIFE\n"), (col < 0 ? recu : \
|
||||
(((ret = 0) || (prs & 8) && addl || 0 && (0
|
||||
|
||||
#include "life.d"
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
static signed char a[] = {0x69,
|
||||
110, 118, 97, 108, 105, 0x64, 1-1,
|
||||
0x6d, 111, 118, 101, 1<<1<<1<<1<<1<<1,
|
||||
114, 105, 0x6e, 103, 32, 'o'/3, 100,
|
||||
32, 102, 114, 111, 0x6d, 32, 115, 116,
|
||||
97, 100-001, 107, 32,37, 2*'2', '@'>>1,
|
||||
116, '%' + '%' + '%','w'-'W',115, 0x74,
|
||||
97, 3*'!', 107, 'q' - 'Q', 37, 10*'\n',
|
||||
10, 0}, * b = a + (1<<1<<1<<1), * w, x,
|
||||
*q, c, r; int main(int d, char *e []) {
|
||||
return q = (signed char *)(e+1+1), (r =
|
||||
e[0] && e[1] ? 0 : 0 * puts (a) + 1) ||
|
||||
(r = e[1<<1] && d != 1 <<1 && 0 * puts(
|
||||
a) + 1) || e[1- -1] || (r = atoi(e[1])
|
||||
< -0200 || atoi (e [1]) > 0x7f || ( x =
|
||||
atoi( e[1] ) ) == 0 ? 0 * puts(a) + 1 :
|
||||
0) || e [1- -1] || (x- -x > 1-1 ? (q[0]
|
||||
= x, q[1] = q[3] = 1, q[2] = 2) : (
|
||||
memset ( w = ( signed char * )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
malloc(-x), '1', -x), puts (w),
|
||||
q[0] = x, q[1] = '0', q[2] = q[3] =
|
||||
0)), r || (q[3] ? (c = 6 - q[1] - q[2],
|
||||
(q[0] != 1) ? q[0]-- , d = q[2], q[2] =
|
||||
c, main(2, e), c = q[2], q[2] = d, q[0]
|
||||
++ : 0, printf(b, q[0], q[1], q[2]), (q
|
||||
[0] != 1) ? q[0]--, d = q[1],q[1] = c ,
|
||||
main(2, e), c = q[1], q[1] = d, q[0] ++
|
||||
: 0) : - 1 - q[0] - 1 == 0 ? (w[- x - 1
|
||||
- (q[1] & 1 ^ 1)] = q[1], puts (w), w [
|
||||
- x - 1 - (q[1] & 1)] = q[1], puts(w) )
|
||||
: - 1 - q[0] == 0 ? (w[- x - 1] = q[ 1
|
||||
], puts(w)) : (q[0] += 1 + ( q[1] & 1
|
||||
^ 1), main(2, e), q[0] -= 1 + ( q
|
||||
[1] & 1 ^ 1), q[1] & 1 ? (q
|
||||
[0]+=1+1, q[1]^=1, main
|
||||
(2, e), q[1]^=1, q[0]-=1
|
||||
+1) : 0, w[q[0] - x] = q
|
||||
[1], puts(w), q[1] & 1 ?
|
||||
0 : (q[0]+=1+1, q[1]^=1,
|
||||
main (2, e), q[1]^=1, q
|
||||
[0]-=1+1), q[0] += 1 +
|
||||
(q[1] & 1),main(2,e)
|
||||
, q[0] -= 1 + (q[1]
|
||||
& 1) ) ), r; }
|
||||
@@ -0,0 +1,125 @@
|
||||
G int i,j
|
||||
K case
|
||||
R return 0
|
||||
S( x,y) for(x=0; x<y; x++)
|
||||
I S(i,10
|
||||
z I-6)B[t][u
|
||||
t (X[m].b[i].i+g)
|
||||
u (X[m].b[i].j+l)
|
||||
M( x,y) XFillRectangles(D,p,x,a,y);
|
||||
s B[i][j
|
||||
W =XCreateGC(D,p,4,L)
|
||||
E( W,_) k=0; I)S(j,22)if(W s]){ a[k].x=i*20; a[k].y=j*20+30; a[k].w=a[k].h=_; k++; }M(
|
||||
A( W,_) &&!B[W]; if(!j){ z]=1; R; } else{ N(m); _; v(0); }
|
||||
Q ]=0; I-6&&j)j=
|
||||
F I-6)B[X[w].b[i].i+g][X[w].b[i].j+l
|
||||
e( x) break; K x:q(c,j,x);
|
||||
H (m){ G; I-6){ a[i].x=t*20; a[i].y=u*20+30; a[i].w=a[i].h=
|
||||
v( _) d(m); z+_]=1; R+1;
|
||||
struct{
|
||||
short x,y,w,h;
|
||||
} a[220],C;
|
||||
struct{
|
||||
struct{
|
||||
G;
|
||||
} b[4];
|
||||
} X[99];
|
||||
G,l,g=3,p,B[10][22],L[99],o[99],n,r,h,_[4],D,J,T;
|
||||
f(){
|
||||
*L=2;
|
||||
n||XSendEvent(D,p,n=1,0,L),XFlush(D);
|
||||
P();
|
||||
}
|
||||
Z(){
|
||||
_[1]=_[3]=(9-h)*40000;
|
||||
setitimer(0,_,0);
|
||||
}
|
||||
main(){
|
||||
G,*_=(int*)X;
|
||||
char*c=
|
||||
"*{{{ {}{{*{{{ {}* { {{*{{{ *{{{ {* {* * { {{ { { *{* { {* *{{{ *{{{ { * { { *{{{ {{ *{{ { {{* { {*{{ {{ {{ {* { {*{{ { *{{{{ *{{ {{ ";
|
||||
for(; *c; )
|
||||
*_++=(unsigned)(*c+++2)%4;
|
||||
srand(time(0));
|
||||
L[10]=32769;
|
||||
D=XOpenDisplay(0);
|
||||
L[1]=L[2]=XWhitePixel(D,j=XDefaultScreen(D));
|
||||
XMap@p=XCreate@XRoot@j),0,0,200,470,2,0,1,0,2056,L));
|
||||
T W;
|
||||
L[2]=XBlackPixel(D,j);
|
||||
J W;{
|
||||
G,O=0,c=0;
|
||||
Z(P());
|
||||
q(c,c,1);
|
||||
for(; ; ){
|
||||
i=lK();
|
||||
j=c;
|
||||
switch(i){
|
||||
K 'k':c=q(c="$#&'(%)+,-*/01.3254"[c]-35,j,4)?c:j;
|
||||
e('j')e('l')e(32)}
|
||||
if(n){
|
||||
if(!q(c,j,2)){
|
||||
G,n;
|
||||
for(j=21;j-1;j--){
|
||||
n=1;
|
||||
I&&n)n=s];
|
||||
n&&(X9(j++),O++);
|
||||
}
|
||||
n=0;
|
||||
I&&!n)n=B[i][21];
|
||||
Y();
|
||||
r++;
|
||||
c=rand()%19;
|
||||
if(!q(c,c,3))
|
||||
R+puts(L);
|
||||
U(Z(h=O/9));
|
||||
}
|
||||
n=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Y(){
|
||||
G,E(,19)J,k)E(!,20)T,k)U();
|
||||
}
|
||||
lK(){
|
||||
XNextEvent(D,o);
|
||||
switch(*o){
|
||||
K 2:R+o[2]?0:XX k){
|
||||
G=1;switch(k){
|
||||
K 1:z+l]=1;
|
||||
d(m);R+1;
|
||||
K 'j':z Q t A(t-1][u,g--)K 'l':z Q t<9
|
||||
A(1+t][u,g++)K 4:F Q
|
||||
u<22&&t>=0&&t<10&&!B[t][u ];
|
||||
if(!j){
|
||||
F]=1;
|
||||
R;
|
||||
}
|
||||
N(w);
|
||||
v(0)K 32:for(;
|
||||
q(m,m,2);
|
||||
)n=r++;
|
||||
R+1;
|
||||
K 3:l=0;
|
||||
g=3;
|
||||
I-6&&j)j=!B[t][u+l ];
|
||||
if(!j)R;
|
||||
v(l)K 2:z Q(u+1)<22 A(t][u+1,l++)}
|
||||
R;
|
||||
}
|
||||
X9(_){
|
||||
G;
|
||||
for(j=_; j; j--)I)s]=s-1];
|
||||
}
|
||||
U(){
|
||||
void*a=&C;
|
||||
C.w=200;
|
||||
C.h=30;
|
||||
M(T,1);
|
||||
sprintf(L,"Score%9d Level%9d",r,h);
|
||||
XDrawString(D,p,J,7,15,L,29);}
|
||||
P(){
|
||||
signal(14,f);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#define A(x) (e^d)&i?e:(e+=i+i/15-d,d<<=4,i<<=4,x)
|
||||
#define B b+=!((e^d)&i)&&(d|=i),i<<=4,
|
||||
#define C i=15,B B B B d=d<<4|d>>12,
|
||||
#define D=(d=g,b=0,C b<<=4, C C C b)
|
||||
#define E if(**y)goto
|
||||
#define F=a[rand()%c]
|
||||
#define G unsigned short
|
||||
#define H e^=a[z],a[z]^=e,e^=a[z],
|
||||
|
||||
void
|
||||
main
|
||||
(int
|
||||
z,char
|
||||
**y)
|
||||
{G*a
|
||||
,b,c
|
||||
,d,e
|
||||
,f,g
|
||||
,h,i
|
||||
;*(*
|
||||
y+=
|
||||
strlen
|
||||
(*y)
|
||||
-1)^=
|
||||
'd';
|
||||
srand
|
||||
(time
|
||||
(0))
|
||||
;z==
|
||||
2&&
|
||||
sscanf
|
||||
(y[1
|
||||
],"%d"
|
||||
,&z)
|
||||
&&z?
|
||||
0:(z
|
||||
=6);
|
||||
if(!
|
||||
(a=(
|
||||
G*)
|
||||
calloc(
|
||||
z*z*
|
||||
z*z,
|
||||
sizeof
|
||||
(G))
|
||||
)){
|
||||
printf
|
||||
("No\
|
||||
memory\
|
||||
\n");
|
||||
exit
|
||||
(1);
|
||||
}for
|
||||
(c=1
|
||||
;i=15
|
||||
,d=z
|
||||
,c<z
|
||||
*z*z
|
||||
*z&&
|
||||
(e=a
|
||||
[c-1
|
||||
]+1,
|
||||
a[c]
|
||||
=A(A
|
||||
(A(A
|
||||
(0))
|
||||
)),1
|
||||
);c++
|
||||
);*(
|
||||
**y?
|
||||
&g:&
|
||||
e)F;
|
||||
do{
|
||||
printf
|
||||
("(%d): ????\b\b\b\b"
|
||||
,c);E
|
||||
q0;else
|
||||
goto
|
||||
q1;q0:
|
||||
printf
|
||||
("%04X\n"
|
||||
,g+
|
||||
4369
|
||||
);E
|
||||
q2;q1:
|
||||
scanf
|
||||
("%hx"
|
||||
,**y
|
||||
?&h:
|
||||
&g);
|
||||
E q3
|
||||
;g-=
|
||||
4369
|
||||
;q2:
|
||||
printf
|
||||
("??\b\b"
|
||||
);E q1;
|
||||
printf(
|
||||
"%02x\n"
|
||||
,h D
|
||||
);q3
|
||||
:for
|
||||
(z=f
|
||||
=0;(
|
||||
z<c||
|
||||
(c=f
|
||||
,0))
|
||||
&&(H
|
||||
b D!=
|
||||
h,H b
|
||||
||(a[
|
||||
f++]=
|
||||
a[z])
|
||||
,1);z
|
||||
++);
|
||||
}while
|
||||
(h!=
|
||||
64&&
|
||||
c>0&&
|
||||
((g F
|
||||
),1)
|
||||
);printf
|
||||
("\n"
|
||||
);}
|
||||
@@ -0,0 +1 @@
|
||||
char*_=__FILE__;
|
||||
@@ -0,0 +1 @@
|
||||
char*_,*O;main(S,l)char**l;{*(O=*(l+++S-1)-1)=13,*l[1]=0;for(;;)for(printf(*l),_=O-1;_>=*l&&++*_>(S+*O+S)*S;*_--=(S+*O)*S);}
|
||||
@@ -0,0 +1,123 @@
|
||||
/** J.K.Bonfield **
|
||||
^ <
|
||||
^ >
|
||||
< # > v
|
||||
< <
|
||||
< > > < v
|
||||
X X j
|
||||
x X j
|
||||
X x ^ k
|
||||
^ ^
|
||||
^ #
|
||||
X X X X
|
||||
|
||||
^ v
|
||||
v v
|
||||
v #
|
||||
v X
|
||||
v x
|
||||
> # < v
|
||||
> >
|
||||
X X l
|
||||
x X l
|
||||
|
||||
41 20
|
||||
########################################
|
||||
# #
|
||||
# < < < < <> < < < #
|
||||
# > > > <> > > > > #
|
||||
# < < < < <> < < < #
|
||||
# > > > <> > > > > #
|
||||
# < < < < <> < < < #
|
||||
# > > > <> > > > > #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# #
|
||||
# X #
|
||||
########################################*/
|
||||
#include <stdio.h>
|
||||
#include <curses.h>
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
#include <sys/time.h>
|
||||
int _tty_ch;
|
||||
bool _echoit;
|
||||
bool _rawmode;
|
||||
SGTTY _tty;
|
||||
#define U char
|
||||
#define G for(
|
||||
#define I )malloc(sizeof(
|
||||
|
||||
typedef struct z {U x[20]; struct z*y; } j; j*J[2][256];
|
||||
struct timeval v= {0,1<<17} ;
|
||||
U**X,c,*P="noopoqqnr",d;
|
||||
|
||||
j*a(int Q, int i) {
|
||||
G
|
||||
clear(),noecho(),cbreak(); ;
|
||||
)
|
||||
|
||||
{
|
||||
int x=0,y=0,W=Q,Q=i-1,k;
|
||||
G;
|
||||
y<=Q;
|
||||
(mvaddch(y,x,X[y][x]),++x^W-1)||(x=0,y++));
|
||||
k=y=- --x;
|
||||
G
|
||||
refresh(),c=select(k,&y,0,0,&v)?getch():0;
|
||||
k?++x-W||(x=1,++y-Q||(--k,x=W-1,y=Q-1)):--x||(y--,x=W-1),k|y;
|
||||
)
|
||||
|
||||
{
|
||||
j *t;
|
||||
G
|
||||
t=J[1-k][X[y][x]]; t; t=t->y) {
|
||||
U*f=t->x;
|
||||
if (d==f[17]|f[17]==c) {
|
||||
int i=k&2,u=9,k=1,w=x,_=y,T;
|
||||
G;
|
||||
--u||(d-f[8]&&(X[y][x]=f[8]),w---_--,i=0,u=8,k--);) {
|
||||
_+=P[T=i>u?u:i]-'o';
|
||||
w+=P[4+T]-'p';
|
||||
if(k) {
|
||||
if (d-f[i]&&f[i]-X[_][w]) break;
|
||||
i++;
|
||||
} else
|
||||
f[++i+8]-d && (X[_][w]=f[i+8]);
|
||||
} } } } } }
|
||||
|
||||
jmp_buf E;
|
||||
|
||||
int main(int open, U**exit) {
|
||||
FILE*C=fopen (
|
||||
open-2?__FILE__:*++exit,P+8);
|
||||
j*t;
|
||||
volatile int Q,Y=0;
|
||||
int i,q; d=open-2?'\t':'*'; L:
|
||||
|
||||
Q=0; G; setjmp(E)<256; Q--
|
||||
)
|
||||
longjmp(E,(J[Y][Q]=0,Q++));
|
||||
G; ; ) {
|
||||
if(!C)return 1;
|
||||
if('\n'==(c=getc(C)))
|
||||
if(!Y++)goto L; else
|
||||
{ fscanf(C,"%d %d\n",&i,&q);
|
||||
X=(U**I P++)*q*(i+1));
|
||||
Q=0; G; Q<q; Q++)
|
||||
X[Q]=(U*)&X[q]+Q*i;
|
||||
|
||||
fread(*X,(initscr(),q*i),1,C);
|
||||
a(i,Q);
|
||||
}
|
||||
t=(j*I*a(Q--,--Q)));
|
||||
t->y=J[Y][c]; J[Y][c]=t;
|
||||
fgets(t->x,20,C); }
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
#define iii\
|
||||
( I ) if ( ii(I,6\
|
||||
) )I [ strlen(I ) -1]=!1
|
||||
int ii(ll,lll ) char*ll; {
|
||||
|
||||
char *l="\"; !l ? 1.1 : l; l,printf(";int l1=1-/*+&|"); &+|-*/1,li=!1;while
|
||||
|
||||
( lll>l1 ) li|=! ( l[3*l1+++3
|
||||
] -ll[strlen ( ll)-1] ) ;return
|
||||
( li ) ;}main ( ll,lll
|
||||
) char*lll[];{char l1 [ 111][21],li1[111][21 ] ,il1[111],i1l
|
||||
[ 111 ] ;int lli,l11,l1l,li/* ( */,ll1,il,l;FILE*f;if(ll-2
|
||||
) {f=fopen ( lll[1],"r" ) ;lli=l=ll1=il=!1;while
|
||||
( fscanf(f,"%s",l1[lli] ) +1){li=ii ( l1[lli],3
|
||||
) ;iii ( l1[lli] ) ;l1l=l11=!1;while
|
||||
( l1l>-ll ) {iii ( lll[-l1l]
|
||||
) ;strcasecmp ( lll[-l1l--],l1[lli] ) ||
|
||||
( l11=++il ) ;}l11||lli++;if ( li
|
||||
) {if ( ll1<il ) {ll1=il;l1l=l=lli;while
|
||||
( l1l-- ) strcpy ( li1[l1l],l1[l1l]
|
||||
) ;}il=lli=!1;}}if ( !ll1 ) puts
|
||||
( " Beats me." ) ;else if ( !l
|
||||
) puts ( " Yes." ) ;else{*li1[l1l=!1]=toupper
|
||||
( *li1[!1] ) ;while ( l>l1l
|
||||
) printf ( " %s",li1[l1l++] ) ;puts
|
||||
( "." ) ;}}else{sprintf ( il1,"cat %s;echo",lll[1]
|
||||
) ;system ( il1 ) ;}printf
|
||||
( "\n? " ) ;gets ( il1
|
||||
) ;sprintf ( i1l,"%s %s %s",lll[!1 ] ,lll[1],il1);system
|
||||
( i1l); }
|
||||
@@ -0,0 +1,26 @@
|
||||
O5(O2,O7,O3)char**O7;{return!(O2+=~01+01)?00:!(O2-=02>01)?printf("\045\157\012"
|
||||
,O5(012,O7+01,00)):!(O2-=02>>01)?(**O7<=067&&**O7>057?O5(03,O7,*(*O7)++-060+010
|
||||
*O3):O3 ):!(O2 -=-O3- ~O3)? (072>**
|
||||
O7&&060 <=**O7 ?O5(04 ,O7,012 *O3-060
|
||||
+*(*O7 )++):O3 ):!(O2 -=!O3+ !!O3)?(
|
||||
**O7>057 &&**O7 <=071? O5(05, O7,*(*
|
||||
O7)+++ O3*020 -060): **O7<= 0106&&
|
||||
00101<= **O7?O5 (05,O7 ,020*O3 +*(*O7)
|
||||
++-067) :0140<** O7&&** O7<0147 ?O5(05,
|
||||
O7,-0127 +*(*O7 )+++020 *O3):O3 ):!(
|
||||
O2-=02- 01)?(** O7==050 ?050** ++*O7,
|
||||
O5(013, O7,O5( 012,O7 ,00)):* *O7<056
|
||||
&&054<* *O7?055 **++* O7,-O5( 06,O7,
|
||||
00):054 >**O7&& 052<** O7?050* *(*O7)
|
||||
++,O5(06 ,O7,00 ):!(** O7^0170 )||!(
|
||||
0130^** O7)?*++ *O7,O5 (05,O7 ,00):*
|
||||
*O7==0144 ||**O7 ==0104 ?++*O7 ,O5(04,
|
||||
O7,00): O5(03 ,O7,00 )):!-- O2?(*
|
||||
*O7==052 ?O5(07 ,O7,O3* (*++*O7 ,O5(06
|
||||
,O7,00) )):!( 045-** O7)?O5( 07,O7,
|
||||
O3%(03+( *O7)++, O5(06, O7,00) )):!(**
|
||||
O7^057)?O5(07, O7,O3/( 03-*++ *O7,O5(
|
||||
06,O7,00))):O3 ):!(O2 +=01-02 )?O5(07
|
||||
,O7,O5(06,O7, 00)):!( O2+=-02/ 02)?(!(*
|
||||
*O7-053)?O5(011,O7,O3+(++*O7,O5(010,O7,00))):!(055^**O7)?O5(011,O7,O3-(03+*(*O7
|
||||
)++,O5(0010,O7,00))):O3):!(O2-=0563&0215)?O5(011,O7,O5(010,O7,00)):(++*O7,O3);}
|
||||
Reference in new issue
Block a user