uses System.Math;
var
Random1, Random2: Integer;
begin
//new sequence on every run
Randomize;
Random1 := Random(3);
//may return 0, 1 or 2 but not 3
Random2 := RandomRange(1, 4);
//may return 1, 2 or 3 but not 4
WriteLn('random1 is ', Random1);
WriteLn('random2 is ', Random2);
end.