program the2D_GunPlay;
uses crt;
const maxn=20;
var i,j,ch,r:integer;
HP,Power,Range,Luck,x,y:array[1..2]of integer;
Dir:array[1..2,1..2]of integer;
map:array[1..maxn,1..maxn]of integer;
b:array[1..3] of string;
function Num(peo,ee:integer; time:integer):integer;
var e:array[1..2]of integer; i1:integer;
begin
gotoxy(1,maxn+Peo*5-2);
b[1]:='';b[2]:='';b[3]:='';
if ee in[01..09] then textcolor(white);
if ee in[10..24] then textcolor(lightblue);
if ee in[25..44] then textcolor(green);
if ee in[45..70] then textcolor(magenta);
if ee in[71..99] then textcolor(brown);
e[1]:=ee mod 10;
e[2]:=ee div 10;
for i1:=2 downto 1 do
begin
if e[i1]=0 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|\|';
b[3]:=b[3]+'|_|'; end;
if e[i1]=1 then begin b[1]:=b[1]+' ';
b[2]:=b[2]+' | ';
b[3]:=b[3]+' | '; end;
if e[i1]=2 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' _|';
b[3]:=b[3]+'|_ '; end;
if e[i1]=3 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' _|';
b[3]:=b[3]+' _|'; end;
if e[i1]=4 then begin b[1]:=b[1]+' ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+' |'; end;
if e[i1]=5 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_ ';
b[3]:=b[3]+' _|'; end;
if e[i1]=6 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_ ';
b[3]:=b[3]+'|_|'; end;
if e[i1]=7 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' |';
b[3]:=b[3]+' |'; end;
if e[i1]=8 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+'|_|'; end;
if e[i1]=9 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+' _|'; end;
end;
writeln(b[1]);
writeln(b[2]);
writeln(b[3]);
delay(time);
exit(ee);
end;
function Diff(i1,j1,i2,j2:integer):boolean;
begin if (i1=i2)and(j1=j2) then exit(false)
else exit(true); end;
procedure show;
begin
textcolor(lightcyan); gotoxy(y[1],x[1]); writeln(chr(1));
textcolor(lightgreen); gotoxy(y[2],x[2]); writeln(chr(2));
for i:=1 to 2 do
begin
if map[x[i],y[i]]=-1 then inc(HP[i],50+trunc(random(50)));
if map[x[i],y[i]]=-2 then inc(Power[i],3+trunc(random(4)));
if map[x[i],y[i]]=-3 then inc(Range[i],1+trunc(random(2)));
if map[x[i],y[i]]=-4 then inc(Luck[i],4+trunc(random(3)));
if HP[i]>9999 then HP[i]:=9999;
if Power[i]+Luck[i]>100 then
begin Power[i]:=34; Luck[i]:=66; end;
if Range[i]>18 then Range[i]:=18;
map[x[i],y[i]]:=0;
end;
uses crt;
const maxn=20;
var i,j,ch,r:integer;
HP,Power,Range,Luck,x,y:array[1..2]of integer;
Dir:array[1..2,1..2]of integer;
map:array[1..maxn,1..maxn]of integer;
b:array[1..3] of string;
function Num(peo,ee:integer; time:integer):integer;
var e:array[1..2]of integer; i1:integer;
begin
gotoxy(1,maxn+Peo*5-2);
b[1]:='';b[2]:='';b[3]:='';
if ee in[01..09] then textcolor(white);
if ee in[10..24] then textcolor(lightblue);
if ee in[25..44] then textcolor(green);
if ee in[45..70] then textcolor(magenta);
if ee in[71..99] then textcolor(brown);
e[1]:=ee mod 10;
e[2]:=ee div 10;
for i1:=2 downto 1 do
begin
if e[i1]=0 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|\|';
b[3]:=b[3]+'|_|'; end;
if e[i1]=1 then begin b[1]:=b[1]+' ';
b[2]:=b[2]+' | ';
b[3]:=b[3]+' | '; end;
if e[i1]=2 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' _|';
b[3]:=b[3]+'|_ '; end;
if e[i1]=3 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' _|';
b[3]:=b[3]+' _|'; end;
if e[i1]=4 then begin b[1]:=b[1]+' ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+' |'; end;
if e[i1]=5 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_ ';
b[3]:=b[3]+' _|'; end;
if e[i1]=6 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_ ';
b[3]:=b[3]+'|_|'; end;
if e[i1]=7 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+' |';
b[3]:=b[3]+' |'; end;
if e[i1]=8 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+'|_|'; end;
if e[i1]=9 then begin b[1]:=b[1]+' _ ';
b[2]:=b[2]+'|_|';
b[3]:=b[3]+' _|'; end;
end;
writeln(b[1]);
writeln(b[2]);
writeln(b[3]);
delay(time);
exit(ee);
end;
function Diff(i1,j1,i2,j2:integer):boolean;
begin if (i1=i2)and(j1=j2) then exit(false)
else exit(true); end;
procedure show;
begin
textcolor(lightcyan); gotoxy(y[1],x[1]); writeln(chr(1));
textcolor(lightgreen); gotoxy(y[2],x[2]); writeln(chr(2));
for i:=1 to 2 do
begin
if map[x[i],y[i]]=-1 then inc(HP[i],50+trunc(random(50)));
if map[x[i],y[i]]=-2 then inc(Power[i],3+trunc(random(4)));
if map[x[i],y[i]]=-3 then inc(Range[i],1+trunc(random(2)));
if map[x[i],y[i]]=-4 then inc(Luck[i],4+trunc(random(3)));
if HP[i]>9999 then HP[i]:=9999;
if Power[i]+Luck[i]>100 then
begin Power[i]:=34; Luck[i]:=66; end;
if Range[i]>18 then Range[i]:=18;
map[x[i],y[i]]:=0;
end;