#include <stdio.h>
#define U n+g
#define J m+f
#define G gotoxy
#define C printf
#define A rand
int k
,f,g
,q;int
p,m=0,
n=1,d=0
,e=0,a
=2,b=5,c
=5,t=1
,M[22][76
]={-1
,4};L(){
return
a
% 2?(f=
0,g=a
/2?-1:1):(g=0,f=a/2
?1:-
1),(!
M[J][U]||M[J][U]==10||M[J][U]
==-1
);}K(
){M
[J][U]==-1&&E(),M[J][U]!=10?F(
m,n):(t=0),M[J][U]=(
a+2)%4+1;}D(){a-0||((J>=0&&L()
)?(K(),m=J):(a=A()%2
?3:1))
,a-2||((
J<22&&L())?(K(),m=J): (a=A(
)%2?1:
3)),a
-1||(
(U<
76&&L
(
))?(K
(),n=
U):(a
=A()
%2?0
:2))
,a-
3||((
U>=0&&
L()
)?(K
(),n=
U):
(a=A
()%2?
2:0
));}
F(x,y
){M
[x]
[y]
%2?(p
=0,
q=M
[x][
y]/2?1
:-1
):(q
=0,p=
M[x]
[y]
/3?-
1:1),M[x+
q][
y+p]==-1?(M[x+q][y+
p]=
0,b=x +q,c=y+p,M[
x]
[y]=-1):F(x+q,y+p);
}
R(){int x,y;x=A
()%22,y=A()%76,M[x
][y]==0?(M[
x][y
]=10,
G(y+1
,x+2)
,C
("X")
):R()
;}P
(){G(
c+1,b
+2),
C(" "
),G(n
+1,m+
2),C(
"O"),G(e+1,d+2)
,C("o"
) ;}E(){G(10,10),
C("The"
"g"
"ame is over!"), getch( ),
exit();
}main
(){R();while(1){
while
(bioskey(1)
==0)d=m,
e=n,D(),P(),t
==0&&
(R(),t = 1),delay ( 4500);k=
bioskey(0)>>
8,k
-75||(a=3),k-77||(a=1),k-72
||(a=0)
,
k-80||(a=2) ;}}
这才叫草书