Mal meine Lösung, so in der Pause aus dem Kopf....
Auf die Form muss ein Button, Timer, Memo.
Delphi-Quellcode:
implementation
{$R *.dfm}
var RandomZahlAlt: Word;
function RandomForMe(MaxRange: Word): Word;
begin
repeat
Result := Random(MaxRange+1);
until RandomZahlAlt <> Result;
RandomZahlAlt := Result;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Randomize;
Timer1.Interval := 150;
Timer1.Enabled := False;
Button1.Caption := 'Off';
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Memo1.Lines.Append(InttoStr(RandomForMe(100)));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := not Timer1.Enabled;
if Timer1.Enabled then Button1.Caption := 'On'
else Button1.Caption := 'Off'
end;
end.