求pascal游戏
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)
1个回答
展开全部
fpc里面有自带的游戏,走迷宫,打飞机等等
好像是units里的,可能
还有一个同学的,似乎有点无聊
var
plife,plifemax,patt,pre:integer;
gr,ex,exmax:integer;
alife,alife1,aatt,are:integer;
name,fname:string;
na:text;
code,co:string;
dz:integer;
money:longint;
mp,mpmax:integer;
red,blue,knife,clothes:integer;
i:integer;
procedure bag;
var
obj:integer;
begin
writeln;
writeln;
writeln('你的背包');
writeln
('1:红药水 ',red,' 2:蓝药水 ',blue,' 3:箭',knife,' 4:防具',clothes,' 5:退出');
writeln;
writeln;
writeln('你想用哪个');
repeat
readln( obj);
case obj of
1:begin
if red>0 then begin
red:=red-1;
plife:=plife+40;
if plife>plifemax then plife:=plifemax;
end;
end;
2:begin
if blue>0 then begin
blue:=blue-1;
mp:=mp+40;
if mp>mpmax then mp:=mpmax;
end;
end;
3:begin
if knife>0 then begin
knife:=knife-1;
patt:=patt+15;
end;
end;
4:begin
if clothes>0 then begin
clothes:=clothes-1;
pre:=pre+15;
end;
end;
end;
writeln;
writeln;
writeln;
until obj=5;
exit;
end;
procedure bagplus(sh:integer);
begin
case sh of
1:red:=red+1;
2:blue:=blue+1;
3:knife:=knife+1;
4:clothes:=clothes+1;
end;
end;
procedure shop;
var
ob:integer;
begin
writeln;
writeln;
writeln('欢迎你来到勇士商店!');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
repeat
readln(ob);
case ob of
1:begin
if money>=15 then
begin
money:=money-15;
bagplus(1);
writeln('红药水已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
2:begin
if money>=15 then
begin
money:=money-15;
bagplus(2);
writeln('蓝药水已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
3:begin
if money>=30 then
begin
money:=money-30;
bagplus(3);
writeln('一支箭已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
4:begin
if money>=30 then
begin
money:=money-30;
bagplus(4);
writeln('一件铠甲已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
end;
until ob=5;
exit;
end;
procedure storm;
var
ka,kp:integer;
begin
if mp>=30 then begin
writeln;
writeln;
writeln('你使用了暴气波');
writeln('怪的生命',alife1);
writeln('你的生命',plife,'/',plifemax);
kp:=(random(patt)-random(are))*33; ;
if kp>0 then begin
writeln('怪受到',kp,'点伤害');
alife1:=alife1-kp;
end
else begin
writeln('怪躲闪');
end;
ka:=aatt-pre+random(aatt div 4)-aatt div 2;
if ka>0 then begin
writeln('你受到',ka,'点伤害');
plife:=plife-ka;
end
else begin
writeln( '你躲闪');
end;
mp:=mp-30;
end
else writeln('你没魔了');
end;
procedure wall;
var
ka,kp:integer;
begin
if mp>=15 then begin
writeln;
writeln;
writeln('你使用了火球');
writeln('怪的生命',alife1);
writeln('你的生命',plife,'/',plifemax);
kp:=(random(patt)-random(are))*26;
if kp>0 then begin
writeln('怪受到',kp,'点伤害');
alife1:=alife1-kp;
end
else begin
writeln('你躲闪');
end;
ka:=aatt-pre+random(aatt div 4)-aatt div 2;
if ka>0 then begin
writeln('你受到',ka,'点伤害');
plife:=plife-ka;
end
else begin
writeln( '怪躲闪');
end;
mp:=mp-10;
end
else writeln('你没魔了');
end;
你在追问一次吧,空间不够了
好像是units里的,可能
还有一个同学的,似乎有点无聊
var
plife,plifemax,patt,pre:integer;
gr,ex,exmax:integer;
alife,alife1,aatt,are:integer;
name,fname:string;
na:text;
code,co:string;
dz:integer;
money:longint;
mp,mpmax:integer;
red,blue,knife,clothes:integer;
i:integer;
procedure bag;
var
obj:integer;
begin
writeln;
writeln;
writeln('你的背包');
writeln
('1:红药水 ',red,' 2:蓝药水 ',blue,' 3:箭',knife,' 4:防具',clothes,' 5:退出');
writeln;
writeln;
writeln('你想用哪个');
repeat
readln( obj);
case obj of
1:begin
if red>0 then begin
red:=red-1;
plife:=plife+40;
if plife>plifemax then plife:=plifemax;
end;
end;
2:begin
if blue>0 then begin
blue:=blue-1;
mp:=mp+40;
if mp>mpmax then mp:=mpmax;
end;
end;
3:begin
if knife>0 then begin
knife:=knife-1;
patt:=patt+15;
end;
end;
4:begin
if clothes>0 then begin
clothes:=clothes-1;
pre:=pre+15;
end;
end;
end;
writeln;
writeln;
writeln;
until obj=5;
exit;
end;
procedure bagplus(sh:integer);
begin
case sh of
1:red:=red+1;
2:blue:=blue+1;
3:knife:=knife+1;
4:clothes:=clothes+1;
end;
end;
procedure shop;
var
ob:integer;
begin
writeln;
writeln;
writeln('欢迎你来到勇士商店!');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
repeat
readln(ob);
case ob of
1:begin
if money>=15 then
begin
money:=money-15;
bagplus(1);
writeln('红药水已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
2:begin
if money>=15 then
begin
money:=money-15;
bagplus(2);
writeln('蓝药水已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
3:begin
if money>=30 then
begin
money:=money-30;
bagplus(3);
writeln('一支箭已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
4:begin
if money>=30 then
begin
money:=money-30;
bagplus(4);
writeln('一件铠甲已放入你的背包');
writeln(' 1:红药水 2:蓝药水 3:箭 4:防具 5:退出');
writeln(' $15 $15 $30 $30');
writeln;
writeln('你想买什么');
writeln;
end
else writeln('你的钱不够');
end;
end;
until ob=5;
exit;
end;
procedure storm;
var
ka,kp:integer;
begin
if mp>=30 then begin
writeln;
writeln;
writeln('你使用了暴气波');
writeln('怪的生命',alife1);
writeln('你的生命',plife,'/',plifemax);
kp:=(random(patt)-random(are))*33; ;
if kp>0 then begin
writeln('怪受到',kp,'点伤害');
alife1:=alife1-kp;
end
else begin
writeln('怪躲闪');
end;
ka:=aatt-pre+random(aatt div 4)-aatt div 2;
if ka>0 then begin
writeln('你受到',ka,'点伤害');
plife:=plife-ka;
end
else begin
writeln( '你躲闪');
end;
mp:=mp-30;
end
else writeln('你没魔了');
end;
procedure wall;
var
ka,kp:integer;
begin
if mp>=15 then begin
writeln;
writeln;
writeln('你使用了火球');
writeln('怪的生命',alife1);
writeln('你的生命',plife,'/',plifemax);
kp:=(random(patt)-random(are))*26;
if kp>0 then begin
writeln('怪受到',kp,'点伤害');
alife1:=alife1-kp;
end
else begin
writeln('你躲闪');
end;
ka:=aatt-pre+random(aatt div 4)-aatt div 2;
if ka>0 then begin
writeln('你受到',ka,'点伤害');
plife:=plife-ka;
end
else begin
writeln( '怪躲闪');
end;
mp:=mp-10;
end
else writeln('你没魔了');
end;
你在追问一次吧,空间不够了
追问
继续
追答
我发给你的私信了,追问也放不下的
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |