给一些PASCAL小游戏的源程序
发布网友
发布时间:2022-04-24 18:14
我来回答
共5个回答
热心网友
时间:2023-10-31 01:30
program bobo;
uses crt;
type type1=record
h,l,f:integer;
end;
const m:array[1..6,1..16]of integer=
((1,0,1,1,1,0,1,0,1,0,1,1,1,0,0,0),
(1,2,1,2,0,2,1,2,1,2,0,2,0,2,0,2),
(1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,1),
{(0,2,0,2,1,2,0,2,0,2,1,2,1,2,0,2),
(0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0), }
(0,2,1,2,1,2,0,2,0,2,1,2,1,2,1,2),
(0,0,1,0,1,1,1,0,1,0,1,0,1,1,1,1),
(0,2,1,2,0,2,0,2,1,2,0,2,0,2,1,2));
var yellow,white:type1;
ybomb,wbomb:array[1..10]of type1;
fire:array[1..100]of type1;
map:array[0..6,0..16]of integer;
yb,wb,ybo,wbo,yw,yv,wv,ww,tms,ts,tm,t:integer;
yueshi,weili:array[1..10]of type1;
b:boolean;
procere pushtype1(var t:array of type1;th,tl,tf:integer);
var i:integer;
begin
for i:=1 to high(t) do
with t[i] do
if f<=0 then
begin
f:=tf;
h:=th;
l:=tl;
exit;
end;
end;
procere print;
var i,j:integer;
begin
textbackground(black);
clrscr;
for i:=1 to 16 do
for j:=1 to 6 do
if map[j,i] in [1,2] then
begin
if map[j,i]=1 then textcolor(green)
else if map[j,i]=2 then textcolor(brown);
gotoxy(i*4-3,j*4-3);write('>>>>');
gotoxy(i*4-3,j*4-2);write('>>>>');
gotoxy(i*4-3,j*4-1);write('>>>>');
gotoxy(i*4-3,j*4-0);write('>>>>');
end;
for i:=1 to high(fire) do
with fire[i] do
if f>0 then
begin
textcolor(red);
gotoxy(l*4-3,h*4-3);write('>><<');
gotoxy(l*4-3,h*4-2);write('>><<');
gotoxy(l*4-3,h*4-1);write('>><<');
gotoxy(l*4-3,h*4-0);write('>><<');
end;
for i:=1 to high(yueshi) do
with yueshi[i] do
if f>0 then
begin
textcolor(red);
gotoxy(l*4-3,h*4-3);write(' /\ ');
gotoxy(l*4-3,h*4-2);write('/__\');
gotoxy(l*4-3,h*4-1);write('\ /');
gotoxy(l*4-3,h*4-0);write(' \/ ');
end;
for i:=1 to high(weili) do
with weili[i] do
if f>0 then
begin
textcolor(114);
gotoxy(l*4-3,h*4-3);write('____');
gotoxy(l*4-3,h*4-2);write('|/\|');
gotoxy(l*4-3,h*4-1);write('|\/|');
gotoxy(l*4-3,h*4-0);write('/__/');
end;
for i:=1 to high(ybomb) do
with ybomb[i] do
if f>0 then
begin
textcolor(blue);
gotoxy(l*4-3,h*4-3);write(' XX ');
gotoxy(l*4-3,h*4-2);write('| |');
gotoxy(l*4-3,h*4-1);write('| |');
gotoxy(l*4-3,h*4-0);write('\__/');
end;
for i:=1 to high(wbomb) do
with wbomb[i] do
if f>0 then
begin
textcolor(blue);
gotoxy(l*4-3,h*4-3);write(' XX ');
gotoxy(l*4-3,h*4-2);write('| |');
gotoxy(l*4-3,h*4-1);write('| |');
gotoxy(l*4-3,h*4-0);write('\__/');
end;
textbackground(black);
textbackground(black);
if yellow.f>0 then textcolor(14)
else textcolor(12);
gotoxy(yellow.l*4-3,yellow.h*4-3);write('/--\');
gotoxy(yellow.l*4-3,yellow.h*4-2);write('|^^|');
gotoxy(yellow.l*4-3,yellow.h*4-1);write('|\/|');
gotoxy(yellow.l*4-3,yellow.h*4-0);write('\__/');
if white.f>0 then textcolor(15)
else textcolor(12);
gotoxy(white.l*4-3,white.h*4-3);write('/--\');
gotoxy(white.l*4-3,white.h*4-2);write('|^^|');
gotoxy(white.l*4-3,white.h*4-1);write('|\/|');
gotoxy(white.l*4-3,white.h*4-0);write('\__/');
end;
procere newthing(h,l:integer);
var i:integer;
begin
b:=true;
i:=random(3);
if i<=0 then pushtype1(yueshi,h,l,1)
else if i=1 then pushtype1(weili,h,l,1);
end;
procere checkthing;
var i:integer;
begin
for i:=1 to high(yueshi) do
with yueshi[i] do
begin
if (f>0)and(h=yellow.h)and(l=yellow.l) then begin b:=true;inc(yb);f:=0;end;
if (f>0)and(h=white.h)and(l=white.l) then begin b:=true;inc(wb);f:=0;end;
end;
for i:=1 to high(weili) do
with weili[i] do
begin
if (f>0)and(h=yellow.h)and(l=yellow.l) then begin b:=true;inc(yw);f:=0;end;
if (f>0)and(h=white.h)and(l=white.l) then begin b:=true;inc(ww);f:=0;end;
end;
end;
procere runbomby(ch:char);
begin
if ch='q' then halt;
{yellow}
if ch in['f','j','k','l','i'] then
begin
if(ch='f')and(yb>0){and(map[yellow.h,yellow.l]=0)}then
begin dec(yb);pushtype1(ybomb,yellow.h,yellow.l,3);map[yellow.h,yellow.l]:=4;end
else if(ch='j')and(map[yellow.h,yellow.l-1]=0)and(yellow.l>1) then dec(yellow.l)
else if(ch='l')and(map[yellow.h,yellow.l+1]=0)and(yellow.l<16) then inc(yellow.l)
else if(ch='i')and(map[yellow.h-1,yellow.l]=0)and(yellow.h>1) then dec(yellow.h)
else if(ch='k')and(map[yellow.h+1,yellow.l]=0)and(yellow.h<6) then inc(yellow.h);
end
{white}
else if ch in['8','6','5','4','0'] then
begin
if(ch='0')and(wb>0){and(map[white.h,white.l]=0)}then
begin dec(wb);pushtype1(wbomb,white.h,white.l,3);map[white.h,white.l]:=4;end
else if(ch='4')and(map[white.h,white.l-1]=0)and(white.l>1) then dec(white.l)
else if(ch='6')and(map[white.h,white.l+1]=0)and(white.l<16) then inc(white.l)
else if(ch='8')and(map[white.h-1,white.l]=0)and(white.h>1) then dec(white.h)
else if(ch='5')and(map[white.h+1,white.l]=0)and(white.h<6) then inc(white.h);
end;
end;
procere bomb(h,l,w:integer);
const fx:array[1..4,1..2]of -1..1=((1,0),(0,1),(-1,0),(0,-1));
var i,j,xh,xl:integer;
begin
b:=true;
pushtype1(fire,h,l,5);
for j:=1 to 4 do
begin
xh:=h;xl:=l;
for i:=1 to w do
begin
inc(xh,fx[j,1]);
inc(xl,fx[j,2]);
if (xh<1)or(xh>6)or(xl<1)or(xl>16) then break;
if map[xh,xl]=1 then begin pushtype1(fire,xh,xl,5);map[xh,xl]:=0;newthing(xh,xl);break;end
else if map[xh,xl]=2 then break
else pushtype1(fire,xh,xl,5);
end;
end;
end;
procere check;
var i,t:integer;
begin
t:=0;
for i:=1 to high(fire) do
with fire[i] do
begin
if (f>0)and(h=yellow.h)and(l=yellow.l) then begin yellow.f:=0;b:=true;end;
if (f>0)and(h=white.h)and(l=white.l) then begin white.f:=0;b:=true;end;
end;
end;
procere runbomb;
var i:integer;
begin
for i:=1 to high(ybomb) do
with ybomb[i] do
if f>0 then
begin
dec(f);
if f<=0 then
begin
map[h,l]:=0;
bomb(h,l,yw);
inc(yb);
end;
end;
for i:=1 to high(wbomb) do
with wbomb[i] do
if f>0 then
begin
dec(f);
if f<=0 then
begin
map[h,l]:=0;
bomb(h,l,ww);
inc(wb);
end;
end;
end;
procere init;
var i,j:integer;
begin
yb:=1;wb:=1;yw:=1;ww:=1;
textbackground(black);
clrscr;
fillchar(map,sizeof(map),0);
for i:=1 to 6 do
for j:=1 to 16 do
map[i,j]:=m[i,j];
with yellow do begin f:=1;h:=6;l:=1;end;
with white do begin f:=1;h:=1;l:=16;end;
fillchar(ybomb,sizeof(ybomb),0);
fillchar(wbomb,sizeof(wbomb),0);
fillchar(fire,sizeof(fire),0);
fillchar(yueshi,sizeof(yueshi),0);
fillchar(weili,sizeof(weili),0);
tms:=0;tm:=0;ts:=0;
end;
procere main;
var ch:char;
i:integer;
begin
t:=0;
while (white.f=1)and(yellow.f=1) do
begin
b:=false;
delay(8);
inc(tms,10);
if tms=1000 then
begin
tms:=0;
inc(ts);
if ts=60 then
begin
inc(tm);
ts:=0;
end;
end;
if tms mod 100=0 then
for i:=1 to high(fire) do
begin
if fire[i].f=0 then b:=true;
dec(fire[i].f);
end;
if keypressed then
begin
ch:=readkey;
b:=true;
runbomby(ch);
end;
if tms=0 then runbomb;
check;
checkthing;
if b then begin print;inc(t);end;
end;
delay(500);
end;
procere over;
var ch:char;
i:integer;
begin
clrscr;
gotoxy(1,1);
if (white.f=0)and(yellow.f=0) then
begin
writeln('DDD RRR A W W W ');
writeln('D D R R A A W W W W ');
writeln('D D RR AAAAA WW WW ');
writeln('DDD R RR A A W W ');
end
else if yellow.f=0 then
begin
textcolor(15);
writeln('W W W H H IIII TTTTTT EEEEEE W W W OOO N N');
writeln('W W W W HHHHH II TT EE____ W W W W O O NN N');
writeln('WW WW H H II TT EE WW WW O O N NN');
writeln('W W H H IIII TT EEEEEE W W OOO N N');
end
else if white.f=0 then
begin
textcolor(14);
writeln('Y Y EEEEEE L L OOO W W W W W W OOO N N');
writeln(' Y Y EE____ L L O O W W W W W W W W O O NN N');
writeln(' Y EE L L O O WW WW WW WW O O N NN');
writeln(' Y EEEEEE LLLL LLLL OOO W W W W OOO N N');
end;
repeat ch:=readkey;until ch=#13;
end;
begin
while true do
begin
init;
main;
over;
end;
readln;
end.
热心网友
时间:2023-10-31 01:30
uses crt;
type list=record
ty,ax:integer;
end;
xy=record
bx,by:integer;
end;
l1=array[1..4,1..5]of char;
l2=array[1..5,1..6]of char;
l3=array[1..8,1..5]of char;
const
my:l1=(('0','0','A','0','0'),
('A','0','H','0','A'),
('b','H','H','H','d'),
('0','T','U','T','0'));
pl:l3=(('0','H','0','H','0'),
('p','H','I','H','q'),
('0','H','X','H','0'),
('0','V','0','V','0'),
('0','H','H','H','0'),
('0','H','O','H','0'),
('0','H','H','H','0'),
('0','0','V','0','0'));
boss:l2=(('0','T','H','H','T','0'),
('X','H','I','I','H','X'),
('X','H','X','X','H','X'),
('H','0','H','H','0','H'),
('V','0','V','V','0','V'));
var ix,hp,bshp,box,i,j,k,t,sum,every:integer;
enlist:array[1..30]of list;
ch:char;
nowen:array[1..3]of list;
bom,boe:array[1..25]of xy;
procere myij(x:integer);
begin
for k:=1 to 4 do begin
if x>=2 then gotoxy(x-1,21+k)
else gotoxy(x,21+k);
write(' ');
for t:=1 to 5 do
if my[k,t]<>'0' then write(my[k,t]) else write(' ');
if x+4<80 then write(' ');
end;
end;
procere now(enemy:integer);
begin
gotoxy(1,1);
delline;
gotoxy(1,1);
insline;
gotoxy(1,1);
textcolor(black);
write(' Hp:',hp,' Remain enemy:',enemy,' Boss Hp:',bshp);
textcolor(red);
end;
function hiten(s:integer):integer;
begin
hiten:=0;
for t:=1 to 3 do
if (bom[s].by<=6)and(bom[s].bx-nowen[t].ax>=0)
and(bom[s].bx-nowen[t].ax<=4)then hiten:=t;
end;
function hitmy(s:integer):boolean;
begin
hitmy:=false;
if (boe[s].by>=21)and(boe[s].bx-ix>=0)
and(boe[s].bx-ix<=4)then hitmy:=true;
end;
function hitbo(s:integer):boolean;
begin
hitbo:=false;
if (bom[s].by<=7)and(bom[s].bx-box>=0)
and(bom[s].bx-box<=5)then hitbo:=true;
end;
procere clear(s:integer);
begin
for t:=1 to 4 do begin
gotoxy(nowen[s].ax,t+1);
write(' ');
end;
end;
procere win;
begin
clrscr;
gotoxy(28,12);
writeln('Congratulations,You win!');
write(' Press Enter to exit...');
readln;
halt;
end;
procere plij(s,x:integer);
begin
for k:=1 to 4 do begin
if x>=2 then gotoxy(x-1,1+k)
else gotoxy(x,1+k);
write(' ');
for t:=1 to 5 do
if pl[s+k-1,t]<>'0' then write(pl[s+k-1,t]) else write(' ');
if x+4<80 then write(' ');
end;
end;
procere lost;
begin
clrscr;
gotoxy(32,12);
writeln('Sorry,You lost!');
write(' Press Enter to exit...');
readln;
halt;
end;
function canmove(x:integer;y:integer):boolean;
begin
canmove:=false;
if ((x>=2)and(y=1))or((x<=71)and(y=2)) then canmove:=true;
end;
function appear(x:integer):byte;
var f:boolean;
begin
repeat
randomize;
t:=random(70)+2;
f:=true;
for k:=1 to 3 do
if (t-nowen[k].ax>=-5)and(t-nowen[k].ax<=5)then f:=false;
until f;
appear:=t;
if enlist[x].ty=1 then plij(1,t)
else plij(5,t);
end;
function enis:integer;
begin
t:=0;
for k:=1 to 3 do
if nowen[k].ty<>-1 then t:=t+1;
enis:=t;
end;
function itmove(s,t:integer):boolean;
begin
itmove:=true;
for k:=1 to 3 do if k<>s then
if ((t=0)and(nowen[s].ax-nowen[k].ax<7))
or ((t=1)and(nowen[k].ax-nowen[s].ax<7)) then itmove:=false;
end;
procere move(s:integer);
begin
randomize;
t:=random(100) mod 2;
if itmove(s,t) then
if t=0 then begin
if nowen[s].ty=0 then plij(1,nowen[s].ax-1)
else plij(5,nowen[s].ax-1);
nowen[s].ax:=nowen[s].ax-1;
end else if t=1 then begin
if nowen[s].ty=0 then plij(1,nowen[s].ax+1);
if nowen[s].ty=1 then plij(5,nowen[s].ax+1);
nowen[s].ax:=nowen[s].ax+1;
end;
end;
procere bb(s:integer);
begin
if nowen[s].ty=0 then begin
for k:=1 to 25 do
if boe[k].bx=0 then begin
gotoxy(nowen[s].ax+1,6);
write('V');
boe[k].bx:=nowen[s].ax+1;
boe[k].by:=6;
break;
end;
for k:=1 to 25 do
if boe[k].bx=0 then begin
gotoxy(nowen[s].ax+3,6);
write('V');
boe[k].bx:=nowen[s].ax+3;
boe[k].by:=6;
break;
end;
end else begin
for k:=1 to 25 do
if boe[k].bx=0 then begin
gotoxy(nowen[s].ax+2,6);
write('V');
boe[k].bx:=nowen[s].ax+2;
boe[k].by:=6;
break;
end;
end;
end;
procere main;
begin
i:=1;
while 30-i+enis>=0 do begin
gotoxy(1,1);
ch:=' ';
if keypressed then ch:=readkey;
if hp<=0 then lost;
for j:=1 to 25 do
if bom[j].bx<>0 then
if (hiten(j)<>0)or(bom[j].by=2) then begin
if hiten(j)<>0 then begin
clear(hiten(j));
now(30-i+enis);
nowen[hiten(j)].ty:=-1;
nowen[hiten(j)].ax:=0;
end;
gotoxy(bom[j].bx,bom[j].by);
write(' ');
bom[j].bx:=0;
bom[j].by:=0;
myij(ix);
end else begin
gotoxy(bom[j].bx,bom[j].by);
write(' ');
bom[j].by:=bom[j].by-1;
gotoxy(bom[j].bx,bom[j].by);
write('A');
myij(ix);
end;
if sum mod 2=0 then for k:=1 to 25 do
if boe[k].bx<>0 then
if hitmy(k)or(boe[k].by=25) then begin
if hitmy(k) then hp:=hp-1;
gotoxy(boe[k].bx,boe[k].by);
write(' ');
boe[k].bx:=0;
boe[k].by:=0;
myij(ix);
now(30-i+enis);
end else begin
gotoxy(boe[k].bx,boe[k].by);
write(' ');
boe[k].by:=boe[k].by+1;
gotoxy(boe[k].bx,boe[k].by);
write('V');
end;
case ch of
#27:halt;
'a':if canmove(ix-2,1)then begin
ix:=ix-1;
myij(ix);
end;
'd':if canmove(ix-2,2)then begin
ix:=ix+1;
myij(ix);
end;
'j':begin
for j:=1 to 25 do
if bom[j].bx=0 then begin
gotoxy(ix+2,21);
write('A');
bom[j].bx:=ix+2;
bom[j].by:=21;
break;
end;
end;
end;
delay(every);
sum:=sum+1;
if sum mod (every*(every div 3))=0 then for j:=1 to 3 do
if nowen[j].ty<>-1 then begin
bb(j);
move(j);
sum:=0;
end;
for j:=1 to 3 do
if (nowen[j].ty=-1)and(i<31) then begin
nowen[j].ty:=enlist[i].ty;
nowen[j].ax:=appear(j);
i:=i+1;
break;
end;
end;
win;
end;
procere welcome;
begin
clrscr;
gotoxy(29,13);
write('Press Enter to start:');
readln;
writeln(' use: a-left b-right j-bomb');
write(' Please input how fast(suggest 20):');
readln(every);
textbackground(green);
clrscr;
gotoxy(29,13);
writeln('Now upbilnd enemy list...');
for i:=1 to 30 do begin
randomize;
enlist[i].ty:=random(100) mod 2;
end;
for i:=1 to 3 do
with nowen[i] do begin
ty:=-1;
ax:=0;
end;
for i:=1 to 25 do
with bom[i] do begin
bx:=0;
by:=0;
end;
for i:=1 to 25 do
with boe[i] do begin
bx:=0;
by:=0;
end;
delay(500);
clrscr;
textcolor(red);
ix:=38;
hp:=20;
sum:=0;
bshp:=150;
myij(ix);
now(30);
end;
begin
welcome;
main;
end.
热心网友
时间:2023-10-31 01:30
这是扫雷的游戏程序
uses crt;
type
su=array[0..101,0..101,1..2] of integer;
{su[x,y,1]=(is it lei or how many lei around it)}
{su[x,y,2]=(can me see it 0:can't 1:can)}
var
map:su;
x,y,a,b:shortint;
shu:array[1..1000] of integer;
leftlei,realleftlei:integer;
first:boolean;
c:char;
qizi,zhao:array[1..100,1..100] of boolean; {true:user thinks it's lei}
procere init;
var
s:shortint;
begin
x:=1;
y:=1;
clrscr;
writeln('1.Easy(9*9 10)');
writeln('2.Normal(16*16 40)');
writeln('3.Difficult(16*30 100)');
writeln('4.User-defined');
readln(s);
case s of
1:begin a:=9; b:=9; realleftlei:=10; end;
2:begin a:=16; b:=16; realleftlei:=40; end;
3:begin a:=16; b:=30; realleftlei:=100; end;
4:begin write('a,b,lei='); read(a,b,realleftlei); end;
end;
fillchar(map,sizeof(map),0);
fillchar(qizi,sizeof(qizi),false);
clrscr;
first:=false;
leftlei:=realleftlei;
end;
procere play;
procere initmap(a1,a2:shortint);
var
s,x,y,i,j,l:integer;
lshu:integer;
begin
s:=realleftlei;
randomize;
l:=a*b;
for i:=1 to l do shu[i]:=i;
lshu:=l;
while s>0 do
begin
i:=random(lshu)+1;
x:=shu[i] div b;
if shu[i] mod b<>0 then x:=x+1;
y:=shu[i] mod b;
if y=0 then y:=b;
if ((a1<>x) or (a2<>y)or (realleftlei=l)) and (map[x,y,1]<>-1)
then
begin
dec(s); map[x,y,1]:=-1;
for j:=shu[i] to l-1 do shu[j]:=shu[j+1];
dec(lshu);
end;
end;
for x:=1 to a do
begin
for y:=1 to b do
begin
if map[x,y,1]<>-1 then
map[x,y,1]:=ord(map[x-1,y,1]=-1)+ord(map[x-1,y+1,1]=-1)+ord(map[x-1,y-1,1]=-1)+ord(map[x,y+1,1]=-1)+ord(map[x,y-1,1]=-1)+ord(map[x+1,y,1]=-1)+ord(map[x+1,y-1,1]=-1)+ord(map[x+1,y+1,1]=-1);
end;
end;
end;
procere drawmap;
var
g,h:shortint;
begin
textbackground(green);
writeln('left lei:',leftlei);
for g:=1 to a do
begin
for h:=1 to b do
begin
if (map[g,h,2]=0) and (not qizi[g,h])
then
begin
textcolor(white);
if (g=x) and (h=y) then textbackground(yellow);
write(' ');
textbackground(green);
end
else begin
if qizi[g,h]
then
begin
textcolor(red);
if (g=x) and (h=y) then textbackground(yellow);
write(chr(30));
textbackground(green);
end
else
case map[g,h,1] of
-1:begin
textcolor(blue);
if (g=x) and (h=y) then textbackground(yellow);
write('C');
textbackground(green);
end;
else begin
textcolor(red);
textbackground(white);
if (g=x) and (h=y) then textbackground(yellow);
write(map[g,h,1]);
textbackground(green);
end;
end;
end;
end;
writeln;
end;
textcolor(white);
textbackground(black);
writeln('W:up S:down A:left D:right');
writeln('E:exit R:replay');
writeln('Space:enter lei Enter:open the box');
end;
procere find(x,y,f:integer);
var
k:shortint;
begin
if (x>=1) and (x<=a) and (y>=1) and (y<=b) then begin
if (map[x,y,1]<>-1) and (not zhao[x,y])
then begin
map[x,y,2]:=1;
zhao[x,y]:=true;
if map[x,y,1]=0
then begin
if f<>8 then find(x-1,y-1,1);
if f<>7 then find(x-1,y,2);
if f<>6 then find(x-1,y+1,3);
if f<>5 then find(x,y-1,4);
if f<>4 then find(x,y+1,5);
if f<>3 then find(x+1,y-1,6);
if f<>2 then find(x+1,y,7);
if f<>1 then find(x+1,y+1,8);
end;
end; end;
end;
var
n,m,i,j:shortint;
begin
drawmap;
while 1=1 do
begin
repeat
c:=readkey;
c:=upcase(c);
until (c='W') or (c='S') or (c='A') or (c='D') or (c='R') or (c='E') or (ord(c)=32) or (ord(c)=13);
case c of
'W':if x=1 then x:=a else dec(x);
'S':if x=a then x:=1 else inc(x);
'A':if y=1 then y:=b else dec(y);
'D':if y=b then y:=1 else inc(y);
'R','E':exit;
else begin
if ord(c)=32 then
begin
if qizi[x,y]
then begin
if map[x,y,1]=-1 then inc(realleftlei);
inc(leftlei);
end
else begin
if map[x,y,1]=-1 then dec(realleftlei);
dec(leftlei);
end;
qizi[x,y]:=not qizi[x,y];
end
else begin
if not first
then begin initmap(x,y); first:=true; end;
if map[x,y,1]<>-1
then begin
fillchar(zhao,sizeof(zhao),false);
find(x,y,0);
end
else realleftlei:=-1;
end;
end;
end;
if realleftlei=-1
then begin
for x:=1 to a do
for y:=1 to b do
map[x,y,2]:=1;
end;
clrscr;
drawmap;
case realleftlei of
0:begin textcolor(green); writeln('You win'); end;
-1:begin textcolor(red); writeln('You lost'); end;
end;
if (realleftlei=-1) or (realleftlei=0)
then begin
repeat
c:=readkey;
c:=upcase(c);
until (c='R') or (c='E');
exit;
end;
end;
end;
begin
repeat
textcolor(white);
init;
play;
until c='E';
end.
热心网友
时间:2023-10-31 01:31
这是freepascal2.2.0自带的游戏制作指导,你可以看看
*:\FPC\2.2.0\demo\graph\gameunit.pp
我试过,比上面的效果好多了,不像他们,不停的刷屏...
热心网友
时间:2023-10-31 01:32
http://file.pfan.cn/upfile/200804061253578.zip
我自己写的天津麻将.