{ (c) 1998 CREEQ <creeq@web.de> }
program Fenster_Rahmen;
uses Graph, Crt;
var gr_treiber, gr_modus, errorcode : integer;
    sunx, suny : integer;
    y          : integer;
label 1;
begin
  gr_treiber := detect;
  initgraph(gr_treiber, gr_modus, '');
  errorcode := graphresult;
  if errorcode <> grok then
     begin
       write('Grafik-Fehler');
       writeln(grapherrormsg(errorcode));
       closegraph;
       halt;
     end;
  sunx := getmaxx div 2;
  suny := getmaxy div 2;
  y    := getmaxy div 2;
  Randomize;
  setfillstyle(solidfill, lightblue);
  bar(0,0,640,y);
  setfillstyle(solidfill, brown);
  bar(0,y,640,490);
  repeat
  setcolor(lightblue);
  circle(sunx, suny-31, 30);
  setfillstyle(solidfill, lightblue);
  floodfill(sunx, suny-41, lightblue);
  dec(suny);
  setcolor(yellow);
  circle(sunx, suny-31, 30);
  setfillstyle(solidfill, yellow);
  floodfill(sunx, suny-41, yellow);
  delay(10);
  if keypressed then goto 1;
  until suny = 100;
  repeat
  delay(5);
  Setcolor(yellow);
  outtextxy(sunx, suny,'.');
  LineTo(sunx,suny-31);
  LineTo(Random(640), Random(480));
  until KeyPressed;
1:closegraph;
end.
