一个弱智游戏,不妨玩玩
freepascal吧
全部回复
仅看楼主
level 1
Label 1,8,9,10,11,12,13,14;
           var a,b,c,d,e,f,score1,score2,g:integer;
begin
9:
write('请输入石子的总数:   ');
read(a);        writeln;
write('请输入你想要的范围(下限在前,上限在后):   ');
read(b,c);   writeln;
if (a<0) or (b<0) or (b>=c) then begin
writeln('你输入错误了,请再输一次');
goto 9;    end;
writeln('你想要怎样的难易程度?','   1----简单','    其他任意数字键-------困难   ');
read(g); writeln;
8:
   write('你要拿几个?');
     read(d); writeln;
if (d<b) or (d>c) or (d>a) then begin
writeln('你拿的不在范围内或大于总数');
goto 8;
end;
a:=a-d;
write('总数还剩下:',a);     writeln;
if (a>0) and (a<b) then goto 12;
if a=0 then goto 10;
if g=1 then begin
             randomize;
            e:=random(c-b)+b;
          goto 13;    end
else begin
   if (a mod (b+c)>=b) and (a mod (b+c)<=c) then begin
   e:=a mod (b+c); goto 13; end;
   if a mod (b+c)=0 then begin
   randomize;
   e:=random(c-b)+b;
   goto 13
    end;
   e:=b;
   1:
if (a-e<b) or (a-e>c) then goto 13 else
if e=c then goto 13 else begin e:=e+1; goto 1;
end;     end;            13:       a:=a-e;
write('我拿了:',e);    writeln;
write('我拿了之后总数还有:',a);    writeln;
if a>0 then if a<b then goto 12;
if a=0 then goto 11; goto 8;
10:     writeln('你赢了');   score1:=score1+10;      goto 14;
11:     writeln('输给我了哦'); score2:=score2+10;       goto 14;
12:     writeln('我们谁都拿不到,所以是平局');        goto 14;
14:writeln('你现在的分数是:',score1); writeln;
     writeln('我的分数是:',score2); writeln;
   writeln('再来一局吗?','   1键退出','   其他任意数字键继续');
readln(f);
if f<>1 then goto 9;
if score1>score2 then writeln('最后还是你赢啊,下次一定赢你');
if score1<score2 then writeln('你最后还是输了,回去修炼一千年再来挑战我吧');
if score1=score2 then writeln('不错不错,竟然跟我打平');
readln
end.

2011年06月18日 07点06分 1
level 3
给你看看再弱智点的。
猜数字………………
var
a,b,c:integr;
begin
readln(b);
a:=random(b);
repeat
readln(c);
if a>c then writeln('small');
if a=c then writeln('you is god');
if a<c then writeln('big');
until a=c;
readln(c);
end;
2012年02月19日 13点02分 2
level 3
[Yeah] 晕死你呀!!!! 长死了 我是初手 55555555
2012年02月23日 08点02分 3
level 1
都是神马东东啊
2016年07月22日 12点07分 5
1