Jump to content
Sign in to follow this  
FasterProgm

Casa Dev-Pascal Free

Recommended Posts

FasterProgm

Olá pessoal, não sabendo bem onde postar esta dúvida decidi postar aqui, desde já peço que se não coloquei a duvida em sitio certo peço aos mods para mudar a mesma.

uses crt, graph;

procedure iniciamodografico;

var gd,gm : smallint;
begin
gd:=detect;
initgraph (gd,gm,'C:\Dev-Pas');
If Graphresult<>GrOk then
   Halt(1);
end;

procedure triangulo(x1,y1,x2,y2,x3,y3:integer);
var
triang:array[1..3]Of PointType;
begin
with triang[1] do begin x:=x1; y:=y1 end;
with triang[2] do begin x:=x2; y:=y2 end;
with triang[3] do begin x:=x3; y:=y3 end;
fillpoly(3, triang);
end;

procedure quadrilatero(x1,y1,x2,y2,x3,y3,x4,y4:integer);
var
quadr:array[1..4]Of PointType;
begin
with quadr[1] do begin x:=x1; y:=y1 end;
with quadr[2] do begin x:=x2; y:=y2 end;
with quadr[3] do begin x:=x3; y:=y3 end;
with quadr[4] do begin x:=x4; y:=y4 end;
fillpoly(4, quadr);
end;

procedure telhado;
begin
setfillstyle(2, lightred);
triangulo(200,200,400,200,300,120);
setfillstyle(3, red);
triangulo(400,200,450,150,300,120);
end;

procedure paredes;
begin
setfillstyle(solidfill, yellow);
quadrilatero(200,200,200,270,400,270,400,200);
setfillstyle(solidfill, brown);
quadrilatero(400,200,400,270,450,210,450,150);
end;

procedure porta;
begin
setlinestyle(0,1,3); setcolor(brown);
setfillstyle(solidfill, brown);
bar(280,230,320,270);
setfillstyle(solidfill, cyan);
pieslice(300,230,0,180,20);
line(300,210,300,230);
end;

procedure janelas;
begin
setfillstyle(solidfill, cyan);
bar(215,230,255,260);
bar(345,230,385,260);
pieslice(235,230,0,180,20);
pieslice(365,230,0,180,20);
setlinestyle(0,1,3); setcolor(brown);
rectangle(215,230,255,260);
rectangle(345,230,385,260);
line(235,210,235,260);
line(365,210,365,260);
end;

begin
textbackground(green);
iniciamodografico;
telhado;
paredes;
porta;
janelas;
repeat until keypressed;
closegraph;
end.

o problema é o seguinte, o telhado e cores das paredes não funcionam, podia-me ajudar?? Obrigado desde já a todas as respostas  :thumbsup:


“Algo só é impossível até que alguém duvide e resolva provar ao contrário.” Albert Einstein

Share this post


Link to post
Share on other sites
FasterProgm

Obrigado pela ajuda, mas já não é preciso, resolvi o problema!  :cheesygrin:

Solução:

uses crt, graph;

procedure iniciamodografico;

var gd,gm : smallint;
begin
gd:=detect;
initgraph (gd,gm,'C:\Dev-Pas');
If Graphresult<>GrOk then
   Halt(1);
end;

procedure triangulo(x1,y1,x2,y2,x3,y3:integer);
var
triang:array[1..3]Of PointType;
begin
with triang[1] do begin x:=x1; y:=y1 end;
with triang[2] do begin x:=x2; y:=y2 end;
with triang[3] do begin x:=x3; y:=y3 end;
fillpoly(3, triang);
end;

procedure quadrilatero(x1,y1,x2,y2,x3,y3,x4,y4:integer);
var
quadr:array[1..4]Of PointType;
begin
with quadr[1] do begin x:=x1; y:=y1 end;
with quadr[2] do begin x:=x2; y:=y2 end;
with quadr[3] do begin x:=x3; y:=y3 end;
with quadr[4] do begin x:=x4; y:=y4 end;
fillpoly(4, quadr);
end;

procedure telhado;
begin
setlinestyle(0,1,3); setcolor(red);
setfillstyle(2, lightred);
triangulo(200,200,400,200,300,120);
setfillstyle(3, red);
triangulo(400,200,450,150,300,120);
end;

procedure paredes;
begin
setlinestyle(0,1,3); setcolor(yellow);
setfillstyle(solidfill, yellow);
quadrilatero(200,200,200,270,400,270,400,200);
setfillstyle(solidfill, brown);
quadrilatero(400,200,400,270,450,210,450,150);
end;

procedure porta;
begin
setlinestyle(0,1,3); setcolor(brown);
setfillstyle(solidfill, brown);
bar(280,230,320,270);
setfillstyle(solidfill, cyan);
pieslice(300,230,0,180,20);
line(300,210,300,230);
end;

procedure janelas;
begin
setfillstyle(solidfill, cyan);
bar(215,230,255,260);
bar(345,230,385,260);
pieslice(235,230,0,180,20);
pieslice(365,230,0,180,20);
setlinestyle(0,1,3); setcolor(brown);
rectangle(215,230,255,260);
rectangle(345,230,385,260);
line(235,210,235,260);
line(365,210,365,260);
end;

begin
textbackground(green);
iniciamodografico;
telhado;
paredes;
porta;
janelas;
repeat until keypressed;
closegraph;
end.


“Algo só é impossível até que alguém duvide e resolva provar ao contrário.” Albert Einstein

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.