SCAR Code:
function RandomBut(Random,But: Integer): Integer;
var
I: Integer;
begin
for I:= 0 to High(Random) do
begin
Result:= Random(Random);
if not Result = But then
begin
break;
end else
begin
if I= High(Random) then
begin
Inc(Result);
Break;
end;
Continue;
end;
end;
end;
Try that , written in post so may not work.
Edit:
Da 0wner was right your standars are more off
SCAR Code:
function RandomSkip(fromwhat, towhat : integer; skipnums : TIntegerArray) : integer;
var
ii : integer;
begin
if getarraylength(skipnums) = 0 then
Exit;
repeat
result := randomrange(fromwhat, towhat);
for ii := 0 to high(skipnums) do
begin
if result <> skipnums[ii] then
Exit;
end;
until(result <> skipnums[ii]);
end;
SCAR Code:
for ii := 0 to high(skipnums) do
begin
I know your ment to do 2 spaces areter a for do but if its a begin forget the spaces. same with an if then.