Program Spin;

{  A simple graphics demonstration using the hires screen.  This program  }
{  uses the external function LINE.INV which must reside on the default   }
{  drive in order to compile the program.   Jeff Firestone  June, 1984.   }

Const
  grid = 5;
  oneToFour = 1.50;
  ay = 0;
  bx = 400;
  cy = 199;
  dx = 0;
Var
  ax, by, cx, dy, i : integer;

procedure Line(a,b,c,d,e:integer); External 'Line.INV';

begin
  ax:= 0;
  by:= 0;
  cx:= bx;
  dy:= cy;
  hires; hiresColor(7);
  for i:= 1 to (bx + cy) div (round(oneToFour * grid)) do
  begin
    Line(ax, ay, bx, by, 1);
    Line(bx, by, cx, cy, 1);
    Line(cx, cy, dx, dy, 1);
    Line(dx, dy, ax, ay, 1);
    ax:= ax + grid;
    by:= by + grid;
    if by > 639 then by:= 639;
    cx:= cx - grid;
    if cx < 0 then cx:= 0;
    dy:= dy - grid;
    if dy < 0 then dy:= 0;
  end;
end.
Init;
