21/03/10 16:32
djleo
Ho modificato la procedura editor
si usano i trasti w s a d
si usano i trasti w s a d
procedure editor; var d,a,b:integer; tasto:char; f:text; exi:boolean; punti:array[1..1000] of integer; salvataggio:string[15]; begin clrscr; exi:=false; a:=0; b:=0; d:=0; gotoxy(1,1); write('Nome mappa: '); readln(salvataggio); clrscr; repeat if a=81 then a:=80; if a=-1 then a:=1; if b=23 then b:=22; if b=-1 then b:=1; gotoxy(a,b); tasto:=readkey; if tasto='d' then a:=a+1; if tasto='a' then a:=a-1; if tasto='w' then b:=b-1; if tasto='s' then b:=b+1; if tasto=#13 then begin d:=d+1; punti[d]:=b*100+a; write('#'); end; if tasto=char(27) then exi:=true; until exi; a:=0; assign(f,salvataggio); rewrite(f); for a:=1 to d do begin write(f,punti[a]); write(f,' '); end; close(f); end;
aaa