有能用PASCAL编贪吃蛇的顶一下

来源:百度知道 编辑:UC知道 时间:2024/05/31 01:52:56
我要的是源程序,编得出的最先的人获得积分(要用PASCAL).

uses crt;
const screenwidth=50;
screenheight=24; wallchar='#'; snakechar='*'; foodchar='@'; type point=record x,y:integer; end; var snake:array [0..500] of point; map:array [0..screenwidth,0..screenheight] of 0..2; direct:0..3; score:integer; wallnum,foodnum:integer; procedure copyright; begin gotoxy(55,18); textcolor(yellow); writeln('Version a1.0'); gotoxy(55,19); writeln('Coder:RedRooT|R.39'); gotoxy(55,20); writeln('QQ:'); gotoxy(55,21); writeln('E-mail:'); gotoxy(60,22); writeln('cfo@cnnb.net'); gotoxy(55,23); writeln('@2002,N.B.S.T-BIT Dep.'); end; procedure rc; begin gotoxy(1,1); end; function hitself(x,y:integer):boolean; var i:integer;ret:boolean; begin ret:=false; for i:=1 to snake[0].x do if ((snake[i].x=x) and (snake[i].y=y)) then begin ret:=true; exit; end; hitself:=ret; end; function hit:boolean; var t:Point; begin t:=snake[1]; if direct=0 then t.y:=t.y-1; if direct=1 then t.x:=t.x+1; i