{ (c) 1998 CREEQ <creeq@web.de> }
program Ball;
uses Crt, Graph;
var
  Gd, Gm     : Integer;
  x, y, a, b : Integer;
label 1,2,3,4;

begin
  x := 650;
  y := 490;
  a := -10;
  b := 490;
  Gd := Detect;
  InitGraph(Gd, Gm, '');
  if GraphResult <> grOk then
    Halt(1);
  setcolor(white);
  circle(x,y,10);
  circle(a,b,10);
1:repeat
  delay(2);
  setcolor(black);
  circle(x,y,10);
  circle(a,b,10);
  dec(x);
  dec(y);
  inc(a);
  dec(b);
  setcolor(white);
  circle(x,y,10);
  circle(a,b,10);
  if keypressed then halt;
  if y = 10 then goto 2;
  if x = 10 then goto 4;
  until false;
2:repeat
  delay(2);
  setcolor(black);
  circle(x,y,10);
  circle(a,b,10);
  dec(x);
  inc(y);
  inc(a);
  inc(b);
  setcolor(white);
  circle(x,y,10);
  circle(a,b,10);
  if keypressed then halt;
  if y = 469 then goto 1;
  if x = 10 then goto 3;
  until false;
3:repeat
  delay(2);
  setcolor(black);
  circle(x,y,10);
  circle(a,b,10);
  inc(x);
  inc(y);
  dec(a);
  inc(b);
  setcolor(white);
  circle(x,y,10);
  circle(a,b,10);
  if keypressed then halt;
  if y = 469 then goto 4;
  if x = 629 then goto 2;
  until false;
4:repeat
  delay(2);
  setcolor(black);
  circle(x,y,10);
  circle(a,b,10);
  inc(x);
  dec(y);
  dec(a);
  dec(b);
  setcolor(white);
  circle(x,y,10);
  circle(a,b,10);
  if keypressed then halt;
  if y = 10 then goto 3;
  if x = 629 then goto 1;
  until false;
  CloseGraph;
end.


