Skip to content

Instantly share code, notes, and snippets.

@residentkrm
Created July 17, 2013 16:20
Show Gist options
  • Save residentkrm/6022102 to your computer and use it in GitHub Desktop.
Save residentkrm/6022102 to your computer and use it in GitHub Desktop.
program graphics;
uses graph;
var gd,gm,xc,yc:integer;
fills:array[1..3] of PointType;
begin
gd:=detect;initgraph(gd,gm,'C:\TP\BGI');
if graphresult <> 0 then halt(1);
xc:=100;yc:=100;
SetFillStyle(3,GetMaxColor);
pieslice(xc,yc,270,360,75);pieslice(xc,yc,180,270,75);
FillPoly(SizeOf(fills) div SizeOf(PointType), fills);
line(xc-90,yc,xc+90,yc);line(xc,yc-90,xc,yc+90);
moveto(xc-75-16,yc+2);outtext('-1');
moveto(xc+75+2,yc+2);outtext('1');
moveto(xc+2,yc-75-8);outtext('1');
moveto(xc+2,yc+75+2);outtext('-1');
moveto(xc+90-8,yc-9);outtext('X');
moveto(xc-9,yc-90);outtext('Y');
readln;cleardevice;
closegraph
end.
program graphics;
uses graph;
var gd,gm,xc,yc:integer;
fills:array[1..4] of PointType;
begin
gd:=detect;initgraph(gd,gm,'C:\TP\BGI');
if graphresult <> 0 then halt(1);
xc:=100;yc:=100;
SetFillStyle(3,GetMaxColor);
fills[1].x:=xc-75;fills[1].y:=yc-75;
fills[2].x:=xc-75;fills[2].y:=yc+75;
fills[3].x:=xc+75;fills[3].y:=yc+75;
fills[4].x:=xc+75;fills[4].y:=yc-75;
FillPoly(SizeOf(fills) div SizeOf(PointType), fills);
line(xc-90,yc,xc+90,yc);line(xc,yc-90,xc,yc+90);
moveto(xc-75-16,yc+2);outtext('-1');
moveto(xc+75+2,yc+2);outtext('1');
moveto(xc+2,yc-75-8);outtext('1');
moveto(xc+2,yc+75+2);outtext('-1');
moveto(xc+90-8,yc-9);outtext('X');
moveto(xc-9,yc-90);outtext('Y');
readln;cleardevice;
closegraph
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment