()
Newbie
Messaggi:
Iscritto:
|
Ma il punto è che se lascio C:\tp\bgi il prog funziona. E' quando metto driver che non parte... comunque ecco il codice:
program grafica;
uses crt,graph;
var dr,mo,x,y:integer;
m:char;
procedure omino(x,y,colore:integer);
begin
setcolor(colore);
circle(x+15,y,20);
rectangle(x+10,y+20,x+20,y+40);
line(x-10,y+25,x+10,y+25);
line(x+20,y+25,x+40,y+25);
line(x+20,y+40,x+25,y+60);
line(x+10,y+40,x+5,y+60);
end;
begin
clrscr;
dr:=detect;
initgraph(dr,mo,'\driver');
x:=300;y:=220;
omino(x,y,white);
repeat
outtextxy(10,10,'Usa il tastierino numerico per spostarti e premi ''e'' per uscire');
m:=readkey;
if m='2' then
begin
omino(x,y,black);
y:=y+5;
omino(x,y,white)
end
else
if m='4' then
begin
omino(x,y,black);
x:=x-5;
omino(x,y,white)
end
else
if m='6' then
begin
omino(x,y,black);
x:=x+5;
omino(x,y,white)
end
else
if m='8' then
begin
omino(x,y,black);
y:=y-5;
omino(x,y,white)
end
else
if m='1' then
begin
omino(x,y,black);
x:=x-3;y:=y+3;
omino(x,y,white)
end
else
if m='3' then
begin
omino(x,y,black);
x:=x+3;y:=y+3;
omino(x,y,white)
end
else
if m='7' then
begin
omino(x,y,black);
x:=x-3;y:=y-3;
omino(x,y,white)
end
else
if m='9' then
begin
omino(x,y,black);
x:=x+3;y:=y-3;
omino(x,y,white)
end
until m='e';
closegraph
end.
|