This simple program will draw several randomly sized and colored lines on the screen. Makes a good screensaver!

Program RandColorLines;

Uses Crt, Graph;

Var GraphDriver, GraphMode: Integer;
      X, Y: Integer;

Begin
   GraphDriver := Detect; {This automatically detects the GraphicsDriver}
   InitGraph(GraphDriver, GraphMode, ' ');  
   {The ' ' is where the BGI file is stored on your Harddrive}
   {For me it is 'C:\TP\BGI'}
   X := GetMaxX;
   Y := GetMaxY;
   Randomize;  {This Enables the Random feature}

  While Not Keypressed Do
  Begin
      Delay(20);  {Delays drawing of a line to once every 20 milliseconds}
      SetColor(1 + Random(GetMaxColor));
      Line(Random(X), Random(Y), Random(X), Random(Y));
   End;

   Repeat Until Keypressed;
   Closegraph
End.