游戏:
Program Example7;
Uses mouse,dos;
label 1;
type
arr=array[0..48,0..79] of integer;
var
a:arr;
i,j:integer;
h1,m1,s1,hs1,h2,m2,s2,hs2:word
;s:string;
Procedure Asss;
var
a,b,c,d:integer;
begin
gettime(h2,m2,s2,hs2);
a:=h2-h1;
b:=m2-m1;
c:=s2-s1;
d:=hs2-hs1;
if d<0 then begin d:=d+60;c:=c-1;end;
if c<0 then begin c:=c+60;b:=b-1;end;
if b<0 then begin b:=b+60;a:=a-1;end;
writeln('You take:',a,':',b,':',c,':',d);
donemouse;
end;
begin
writeln('input map''s name');
readln(s);
gettime(h1,m1,s1,hs1);
fillchar(a,sizeof(a),0);
assign(input,S+'.map');
reset(input);
InitMouse;
for i:=0 to 48 do
begin
readln(s);
for j:=0 to 79 do
a[i,j]:=ord(s[j+1])-48;
s:='';
end;
close(input);
repeat
writeln(getmousex,',',getmousey);
until (getmousex=0) and (getmousey=250);
for i:=0 to 48 do
begin
for j:=0 to 79 do
if a[i,j]=0 then write(' ') else if a[i,j]=1 then write('@')
else if a[i,j]=3 then write('XXX');
end;
repeat
getmousex;getmousey;
if (a[getmousey-250,getmousex]=1) or (getmousey-250=50)then
begin
writeln('You are lost');
asss;
exit;
end;
until (getmousey-250>=33) and (getmousey-250<=36) and
(getmousex=79);
writeln('You are succse');
asss;
end.
Program Example7;
Uses mouse,dos;
label 1;
type
arr=array[0..48,0..79] of integer;
var
a:arr;
i,j:integer;
h1,m1,s1,hs1,h2,m2,s2,hs2:word
;s:string;
Procedure Asss;
var
a,b,c,d:integer;
begin
gettime(h2,m2,s2,hs2);
a:=h2-h1;
b:=m2-m1;
c:=s2-s1;
d:=hs2-hs1;
if d<0 then begin d:=d+60;c:=c-1;end;
if c<0 then begin c:=c+60;b:=b-1;end;
if b<0 then begin b:=b+60;a:=a-1;end;
writeln('You take:',a,':',b,':',c,':',d);
donemouse;
end;
begin
writeln('input map''s name');
readln(s);
gettime(h1,m1,s1,hs1);
fillchar(a,sizeof(a),0);
assign(input,S+'.map');
reset(input);
InitMouse;
for i:=0 to 48 do
begin
readln(s);
for j:=0 to 79 do
a[i,j]:=ord(s[j+1])-48;
s:='';
end;
close(input);
repeat
writeln(getmousex,',',getmousey);
until (getmousex=0) and (getmousey=250);
for i:=0 to 48 do
begin
for j:=0 to 79 do
if a[i,j]=0 then write(' ') else if a[i,j]=1 then write('@')
else if a[i,j]=3 then write('XXX');
end;
repeat
getmousex;getmousey;
if (a[getmousey-250,getmousex]=1) or (getmousey-250=50)then
begin
writeln('You are lost');
asss;
exit;
end;
until (getmousey-250>=33) and (getmousey-250<=36) and
(getmousex=79);
writeln('You are succse');
asss;
end.