Pascal版2048

最近几个月我一直在写2048。。。前前后后改了好几次,现在大概已经是1.7版本了。

至于2048的规则请自问度娘。

这个版本的2048和原版有了一些不同。。

1.增加分数奖励系统

   顾名思义。。。就是达到一定分数会有奖励。具体不便透露,请在游戏中自行尝试敲打

2.存档功能

   也是顾名思义。。将当前游戏存档以后可再次读取。。

其余的和原版也并没有什么不同。。。还是自己试试吧。。

传送门:

http://pan.baidu.com/s/1dDGhrf7

【不会传文件把它放在了度娘网盘凑和着看吧】

这个游戏做的可能没有原版好。。当然也不可能做得比原版好,毕竟用的是苦逼的Pascal。。。

不过也没关系。。做这个只是为了消遣,也是为了证明Pascal也能写一些好游戏【自卖自夸】

【另外存档和最高分是以文件形式存储的请不要乱改乱删否则。。。后果自负。。。】

接下来放几张图吧。。。

主界面

当然程序还是有一些bug的。。。发现请指出:)

【新发现超级无敌大bug只要用撤销功能就会全屏方块消失。。。在没有修复之前还是不要用了吧。。。】

至于代码。。。由于写的又臭又长,我就只贴主程序吧。。。

begin
  if not fileexists(name) then
  begin
    assign(point,name);rewrite(point);close(point);
    assign(point2,score);rewrite(point2);close(point2);
  end;
  randomize;cursoroff;l:=1;
  3:textcolor(15);printstart(l);tmp:=' ';dq:=false;cdcz:=false;cd:=false;
  while (tmp<>#13)and((tmp<>#72)or(l=1))and((tmp<>#80)or(l=3)) do
  tmp:=readkey;
  case tmp of
  #13:
  begin
    if l=3 then begin printhighest;cd:=false;goto 3;end;
    if l=2 then begin readcd;if not cdcz then goto 3;end;
  end;
  #72:
  begin
    l:=l-1;
    printstart(l);
    goto 3;
  end;
  #80:
  begin
    l:=l+1;
    printstart(l);
    goto 3;
  end;
  end;
  2:
  start;clrscr;if l=1 then cd:=false;
  while pd do
  begin
    if not one2 and not cxcg and not wujinok and not dq and not save and not cdcz then make else
    begin
      if one2 then one2:=false;
      if wujinok then wujinok:=false;
      if dq then dq:=false;
      if save then save:=false;
      if cdcz then cdcz:=false;
    end;
    1:f:=false;
    if saveok or cd then printcd;
    reward;
    if not pd then break else printtip;
    print2;
    printtail;
    if ice then
    begin
      key:=readkey;
      while key<>#13 do key:=readkey;
      ice:=false;
      clrscr;
      print;
      if not pd then break else printtip;
      printans;
      printtail;
    end;
    if f then begin get(d,b);get(b,a);ans4:=ans3;ans3:=ans2;end;move;
    clrscr;
    if not f then begin writeln('No move!!!');goto 1;end;
    if save then write('Save OK!!!');
    if not wujin then
    for i:=1 to n do
      for j:=1 to n do
      if a[i,j]=2048 then
      begin
        if cd or saveok then clearcd;
        print;
        writeln('You win!!!');writeln('Score:',ans);
        highest;
        writeln('Play again?(Enter)');
        if readkey=#13 then goto 2 else begin halt;end;
      end;
  end;
  if saveok or cd then clearcd;
  writeln('Game over!!!');
  writeln('Score:',ans);
  highest;
  writeln('Play again?(Enter)');
  if readkey=#13 then begin goto 2 end else if readkey<>#13 then writeln('Really?');
  if readkey=#13 then halt
  else begin ice:=true;goto 2;end;
end.                          
【写的太渣,不喜勿喷。】
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值