Bahasa pemrograman pascal membuat tampilan sebuah lingkaran
mengelilingi persegi panjang.
program lingkaran;
uses crt,graph;
var graphicdriver,graphicmode,i: integer;
begin
graphicdriver := detect;
initgraph(graphicdriver,graphicmode,'');
if graphresult<> grOK then halt(1);
cleardevice;
repeat
for i:=1 to 400 do
begin
rectangle(100,100,500,400);
circle(100+i,100,10);
delay(10);
cleardevice;
end;
for i:=1 to 300 do
begin
rectangle(100,100,500,400);
circle(500,100+i,10);
delay(10);
cleardevice;
end;
for i:=1 to 400 do
begin
rectangle(100,100,500,400);
circle(500-i,400,10);
delay(10);
cleardevice;
end;
for i:=1 to 300 do
begin
rectangle(100,100,500,400);
circle(100,400-i,10);
delay(10);
cleardevice;
end;
until keypressed;
end.
0 comments:
Post a Comment
Silahkan tulis masukan dan komentar anda disini