uses graphabc;
procedure drawlight(x, y, r : integer; c : color);
begin
brush.color : = c;
circle(x, y, r);
end;
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;
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.
в паскале
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.
в паскале