uses crt,graph; type PixelType=record x,y:integer; end; const N=5000; var d,r,e,k:integer; x1,y1,x2,y2:integer; a:array[1..N] of PixelType; begin d:=Detect; InitGraph(d,r,''); e:=GraphResult; if e<>grok then writeln(GraphErrorMsg(e)) else begin x1:=getmaxX div 4; y1:=getmaxY div 4; x2:=3*x1; y2:=3*y1; Rectangle(x1,y1,x2,y2); SetViewPort(x1+1,y1+1,x2-1,y2-1,clipon); for k:=1 to N do with a[k] do begin x:=Random(x2-x1); y:=Random(y2-y1); end; repeat for k:=1 to N do with a[k] do PutPixel(x,y,white); if not KeyPressed then for k:=N downto 1 do with a[k] do putpixel(x,y,black) until KeyPressed; {while KeyPressed do k:=ord(readKey);} CloseGraph end; end.