unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids;
type
TForm1 =
class(TForm)
StringGrid1: TStringGrid;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label2: TLabel;
Label3: TLabel;
procedure FormCreate(Sender: TObject);
procedure Edit1Change(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
zufall :
array[0..9]
of integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var a,b : integer;
begin
randomize;
a:=1;
for a:=1
to 10
do
begin
StringGrid1.Cells[a-1,0]:=inttostr(a);
b:=random(100);
zufall[a-1]:=b;
end;
{edit1.Text:='?';
edit2.Text:='?';}
end;
procedure TForm1.Edit1Change(Sender: TObject);
var a :
string;
b : integer;
begin
a:=Edit1.Text;
b:=zufall[strtoint(a)];
Edit2.Text:=inttostr(b);
end;
end.