program graphic; uses crt, graph, MENU; var gd,gm,x,y,col,dx,dy,kol:integer; chosen:word; procedure GetNum; begin x:=0; y:=0; dx:=0; dy:=0; col:=15; Randomize; {repeat} x := Random(540); dx:=(50-Random(30)); dy:=dx; y:=Random(380); col:=Random(15); {until KeyPressed;} end; procedure draw; begin rectangle(x,y,x+dx,y+dy); SetFillStyle(1,col); floodfill(x+1,y+1,15); end; procedure squares; var ch:char; begin gd:=Detect; InitGraph(gd,gm,'C:/WINDOWS/BGI'); repeat ch:=Readkey; if Ord(ch)=13 then begin GetNum; draw; end until Ord(ch)<>13; end; procedure MakeMenu; begin CurrMenu:=Init(50,50,3,7,10); Add('Play',1,CurrMenu); Add('Info',2,CurrMenu); Add('Exit',3,CurrMenu); Show(CurrMenu); chosen:=Choose(CurrMenu); end; begin clrscr; MakeMenu; if chosen=1 then begin GotoXY(100,100); write('Для вывода нового квадрата нажмите Enter. Для выхода нажмите любую другую клавишу'); readln; squares; end; if chosen=3 then halt; if chosen=2 then begin writeln; TextBackGround(0); TextColor(15); writeln('information'); readln; end; end.