Code
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
UsedNums : array [1..15] of Boolean;
RandomValues : array [1..15] of integer;
i,r : Integer;
begin
for i := 1 to 15 do
UsedNums[i] := True;
for i := 1 to 15 do begin
repeat
r := random(60) + 1; // from 1 to 60
until UsedNums[r];
UsedNums[r] := False;
RandomValues[i] := r;
ShowMessage('int' + IntToStr(i)+ '=' +IntToStr(r));
end;
for i:=1 to 15 do
Begin
ShowMessage('int' + IntToStr(i)+ '=' +IntToStr(RandomValues[i]));
end;
end.
Вот собственно код этот.. как видишь после повторного заполнения проскакивают нулевые значения.