Язык:
Русский
English
{ Пример программы для процедуры SetBkColor }
uses Crt, Graph;
var
GraphDriver, GraphMode : Integer;
Palette : PaletteType;
begin
GraphDriver := Detect;
InitGraph(GraphDriver, GraphMode, 'X:\BP');
Randomize;
if GraphResult <> grOk then
Halt(1);
GetPalette(Palette);
repeat
if Palette.Size <> 1 then
SetBkColor(Random(Palette.Size));
LineTo(Random(GetMaxX), Random(GetMaxY));
until KeyPressed;
CloseGraph;
end.
var
GraphDriver, GraphMode : Integer;
Palette : PaletteType;
begin
GraphDriver := Detect;
InitGraph(GraphDriver, GraphMode, 'X:\BP');
Randomize;
if GraphResult <> grOk then
Halt(1);
GetPalette(Palette);
repeat
if Palette.Size <> 1 then
SetBkColor(Random(Palette.Size));
LineTo(Random(GetMaxX), Random(GetMaxY));
until KeyPressed;
CloseGraph;
end.