Dze je subor www.TrSek.com/cover/benkovic/odraz.pas
{ ODRAZ.PAS                                                         }
{ Program ako ukazka odrazu lopticky. Lopticka zanechava stopu      }
{ takze tvori zaujimave obrazce.                                    }
{                                                                   }
{ Datum:16.03.2000                             http://www.trsek.com }

uses Crt, Graph;

var b,a,x2,y2,x1,y1,x,y,i, Gd, Gm: Integer;


begin
 randomize;
 Gd := Detect;
 InitGraph(Gd, Gm, '');

 if GraphResult <> grOk then
    Halt(1);

 x:=random(630);
 y:=random(470);
 a:=random(2);
 b:=random(2);

 if a=1 then x1:=-4
        else x1:=4;
 if b=1 then y1:=-4
        else y1:=4;

 setcolor(0);

 repeat
   PieSlice(x,y,0,360,5);
   x2:=x;
   y2:=y;
   x:=x+x1;
   y:=y+y1;

   if x<= 10 then x1:=-x1;
   if y<= 10 then y1:=-y1;
   if x>=630 then x1:=-x1;
   if y>=470 then y1:=-y1;

   circle(x2,y2,5);
 until keypressed;

 CloseGraph;
end.

Copyrigth by Zdeno Sekerak 2007, http://www.trsek.com