Narysuj prostokąt w dev pascal
program ekran;
uses graph;
var ster,tryb,i:word;
begin
detectgraph(ster,tryb);
initgraph(ster,tryb,'');
line(0,0,getmaxx,getmaxy);
line(0,getmaxy,getmaxx,0);
line(getmaxy div 2,0,getmaxx,getmaxy div 2);
line(0,getmaxy div 2,getmaxx,getmaxy div 2);
for i:=1 to 20 do
line(0,getmaxy div 2,
readln;
closegraph;
end.
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
program prostokat;
uses Crt,Graph;
const
sciezka = 'C:\FPC\';
var
Sterownik,Tryb,x1,y1,x2,y2:integer;
procedure prostokat(x1,y1,x2,y2:integer);
begin
line(x1,y1,x2,y1);
line(x1,y2,x2,y2);
line(x1,y1,x1,y2);
line(x2,y1,x2,y2);
end;
begin
clrscr;
writeln('Podaj wspolrzedne:');
writeln('x1: '); {lewy-gorny rog}
read(x1);
writeln('y1: '); {lewy-gorny rog}
read(y1);
writeln('x2: '); {prawy-dolny rog}
read(x2);
writeln('y2: '); {prawy-dolny rog}
read(y2);
Tryb:= m640x480;
Sterownik:=D8bit;
InitGraph(sterownik,Tryb,Sciezka);
prostokat(x1,y1,x2,y2);
Repeat until keypressed;
CloseGraph;
end.
Jeśli trzeba coś zmienić to pisz.
Pozdrawiam.