Информатика, вопрос задал mrggo , 8 лет назад

Cделать в паскале светофор с помощью GraphABC, Ellipse и Rectangle.

Ответы на вопрос

Ответил srhaafianeulrov60
0

uses graphABC;

 

procedure DrawLight(X, Y, R : Integer; C : Color);

begin

 Brush.Color := C;

 Circle(X, Y, R);

end;

 

begin

 Randomize;

 var V := Random(1, 3);

 var(C1,C2,C3):=(clWhite,clWhite,clWhite);

 case V of

   1 : C1 := clRed;

   2 : C2 := clYellow;

   3 : C3 := clGreen;

 end;

 DrawLight(Window.Center.X, Window.Height div 10 * 2, Window.Height div 7, C1);

 DrawLight(Window.Center.X, Window.Height div 10 * 5, Window.Height div 7, C2);

 DrawLight(Window.Center.X, Window.Height div 10 * 8, Window.Height div 7, C3);

end.

В Паскале


Ответил mrggo
0
Нет
Новые вопросы