﻿uses graphabc;

const
  w = 500;//Ширина окна
  h = 600;//Высота окна

var
  x, y: integer;

procedure snowFall(x0, y0, r: integer);
var
  x, y, i, j, tx, ty: integer;
begin
  setPenColor(clWhite);
  for i := 1 to 6 do
  begin
    x := x0 + round(r * cos(i * (pi / 3)));
    y := y0 - round(r * sin(i * (pi / 3)));
    line(x0, y0, x, y);
    for j := 1 to 6 do
    begin
      tx := x + round((r div 4) * cos(j * (pi / 3)));
      ty := y - round((r div 4) * sin(j * (pi / 3)));
      line(x, y, tx, ty);
    end;
  end;
end;

begin
  setPenColor(clWhite);
  setPenWidth(3);
  setWindowSize(w, h);
  setWindowIsFixedSize(true);
  y := -16;
  x := 200;
  lockDrawing;
  while true do
  begin
    clearWindow(clSkyBlue);
    setPenColor(clYellow);
    setBrushColor(clYellow);
    circle(w div 2, 0, h div 5);
    y := y + 3; //Скорость падения снежинки
    if(y - 2 * 16 > h) then y := -16; 
    snowFall(x, y, 16);
    redraw; 
  end;
end.