procedure braces; VAR x,y,x1,y1,x2,y2:REAL; ymid,xmid,temp:REAL; BEGIN Getrect(x1,y1,x2,y2); {get the box} GetMouse(x,y); {will use this to determine which way the box was drawn} ymid:=(y1+y2)/2; xmid:=(x1+x2)/2; if xymid then begin {box drawn bottom to top} temp:=y1; y1:=y2; y2:=temp; end; if (abs(y2-y1)>abs(x2-x1)) then begin {box drawn taller than wide} beginpoly; moveto(x1,y1); curveto(xmid,y1); curveto(xmid,ymid); lineto(x2,ymid); curveto(xmid,ymid); curveto(xmid,y2); lineto(x1,y2); endpoly; end else begin {box drawn wider than tall} beginpoly; moveto(x1,y1); curveto(x1,ymid); curveto(xmid,ymid); lineto(xmid,y2); curveto(xmid,ymid); curveto(x2,ymid); lineto(x2,y1); endpoly; end; redrawall; END; run(braces);