Смекни!
smekni.com

Получение случайных чисел (стр. 3 из 3)

SetFillStyle(6, 7);

Bar3D(13,27+30*(i-1),13+round(mat[i]*10000),35+30*(i-1), 2, TopOn);

setcolor(green);

SetFillStyle(8, 8);

Bar3D(13,35+30*(i-1),13+round(disp[i]*1000000),43+30*(i-1), 2, TopOn);

end;

SetFillStyle(6, 7);

setcolor(8);

bar(10, 430, 20, 440);

outtextxy(23,432,'- Mat. ozhidanie');

SetFillStyle(8, 8);

bar(10, 450, 20, 460);

outtextxy(23,452,'- Dispersiya');

readkey;

closegraph;

drawwin

end;

end;

end;

{*****DrawMenu*****}

procedure drawmenu(button:byte);

const light=green;{15,14,13,12,11,10,9}

dark=white;{7,6,5,4,3,2,1}

var col:array[1..4]of byte;

exitmenu:boolean;

begin

exitmenu:=false;

textcolor(black);

drawhelp(1);

repeat

for i:=1 to 5 do col[i]:=dark;

col[button]:=light;

gotoxy(1,1);

textbackground(col[1]);write(' Параметры ');

textbackground(col[2]);write(' Последовательности ');

textbackground(col[3]);write(' Гистограмма ');

textbackground(col[4]);write(' Выход ');textbackground(dark);write(' ');

if button<>5 then action:=readkey else exitmenu:=true;

case action of

#77: begin

if button<4 then

begin

col[button]:=dark;

button:=button+1;

col[button]:=light

end

else

begin

col[4]:=dark;

col[1]:=light;

button:=1;

end;

end;

#75: begin

if button>1 then

begin

col[button]:=dark;

button:=button-1;

col[button]:=light

end

else

begin

col[1]:=dark;

col[4]:=light;

button:=4;

end

end;

#27: exitmenu:=true;

#13: case button of

1: begin

dowork(1);

button:=5

end;

2: begin

dowork(2);

button:=5

end;

3: begin

dowork(3);

button:=5

end;

4: begin

exitmenu:=true;

exitprog:=true

end;

end;

end;

if button<>5 then drawhelp(button);

until exitmenu=true;

drawhelp(0);textbackground(dark);gotoxy(1,1);

write(' Параметры Последовательности Гистограмма Выход ');

end;

{*****Главная программа*****}

begin

clrscr;

xcor[1]:=18;

xcor[2]:=18;

xcor[3]:=58;

ycor[1]:=6;

ycor[2]:=8;

ycor[3]:=6;

dat[1]:=5;dat[3]:=5;dat[2]:=4;

grmode:=detect;

grdriver:=detect;

drawwin;

repeat

drawmenu(5);

drawhelp(0);

actionprog:=readkey;

case actionprog of

#59: dowork(1);

#60: dowork(2);

#61: dowork(3);

#68: begin

drawmenu(1);

end;

#45: exitprog:=true;

end;

for i:=1 to 10 do begin mat[i]:=0; disp[i]:=0 end;

until exitprog=true;

end.