-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathanon.c
More file actions
176 lines (159 loc) · 3.6 KB
/
anon.c
File metadata and controls
176 lines (159 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/* Defines */
#ifndef NO_STTY
#define S1 system("stty cbreak -echo")||
#define S2 system("stty echo")||
#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));
}