dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Čuskas problemās iekš Pascal

 
dev.gamez.lv Forum Index -> Programmēšana
View previous topic :: View next topic  
Author Message
Melis



Joined: 07 Jan 2006
Posts: 1

PostPosted: Sat Jan 07, 2006 12:09 am    Post subject: Čuskas problemās iekš Pascal

Problema tāda, ka strap čuskas pedējo gabaliņu un pašu čūsku ir atstarpe.
Vai kāds varētu ieteikt kādu risinājumu?
Code:
program cuska;
uses crt;
const
up=chr(72); down=chr(80);left=chr(75);rigth=chr(77);stop=chr(27);
plat=80; gar=23; z='*';
var
G:array[1..3,1..100] of integer;
kur:char;
dx,dy,i,l,p:integer;
begin
textcolor(magenta);
textbackground(black);
g[1,1]:=40;g[2,1]:=12;
g[1,2]:=41;g[1,2]:=41;
g[2,2]:=12;g[1,3]:=42;g[2,3]:=12;


repeat
if keypressed then
begin
kur:=readkey;
case kur of
up: begin dx:=0;dy:=-1 end;
down:begin dx:=0;dy:=1;end;
left:begin dx:=-1;dy:=0;end;
rigth:begin dx:=1; dy:=0;end;
end; end;

for i:=3 downto 2 do begin
g[2,i]:=g[2,i-1];
g[1,i]:=g[1,i-1];
g[1,1]:=g[1,1]+dx;
g[2,1]:=g[2,1]+dy;
end;
delay(40000);

clrscr;
for p:=1 to 3 do begin
gotoxy(g[1,p],g[2,p]);write(Z);
end;
until kur=stop;
end.
Back to top
View user's profile
loud



Joined: 01 Jan 2006
Posts: 38
Location: Latvia, Sigulda

PostPosted: Sat Jan 07, 2006 12:04 pm    Post subject:

hmm vaitad gamezaa jau tev nepaliidzeeja ? Pats no pascal neko nerubiiju taapeec arii prasu
_________________
Here I am
Back to top
View user's profile Visit poster's website
Display posts from previous:   
dev.gamez.lv Forum Index -> Programmēšana All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group