random


function random(n: integer): integer;

Returns the pseudorandom number between 0 and (n-1).

The following function will return random boolean value; the probability that the returned value is true is 75 %.

  function randomBoolean: boolean;
  begin
    if random(4) = 3 then 
      randomBoolean := false;
    else
      randomBoolean := true;
  end;

See also: randomize