1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Spin, Grids;
type TForm1 = class(TForm) sg1: TStringGrid; bu_start: TButton; SpE_anzahl: TSpinEdit; Label1: TLabel; procedure FormActivate(Sender: TObject); private public end;
var Form1: TForm1; p : array[2..12] of real;
implementation
{$R *.dfm}
procedure TForm1.FormActivate(Sender: TObject); var i,k:integer; begin randomize; brush.color:=random(256)*random(256)*random(256); SpE_anzahl.value:=10; with sg1 do begin cells[0,0]:='Augensumme'; for i:=1 to 11 do begin cells[i,0]:=IntToStr(i+1); end;
for i:=2 to 7 do begin p[i]:=(i-1)/36; cells[i-1,1]:=FloatToStrF((i-1)/36, fffixed,4,5); end;
k:=1; for i:=7 to 11 do begin p[i+1:=p[i-k]; k:=k+2; cells[i,1]:=cells[12-i,1]; end; cells[0,1]:='P(n)'; cells[0,2]:='rH(n)'; end;
end;
end. |