Hello, How I can use "Random" function or another pseudo random number generator in GPC Pascal? Sincerely, a.huici@telia.com
On Mon, 24 Dec 2001, A. Huici wrote:
Hello, How I can use "Random" function or another pseudo random number generator in GPC Pascal? Sincerely, a.huici@telia.com
Simply call:
x:=random(n);
to assign 'x' a pseudo random integer value from the range 0 to n-1. You may also want to use 'randomize;' first (to initalize the generator).
Regards, Adam Naumowicz
-------------------------------------- WWW: http://math.uwb.edu.pl/~adamn/ --------------------------------------
A. Huici wrote:
How I can use "Random" function or another pseudo random number
generator in GPC Pascal?
Random (n)
(where n is an integer) gives a pseudo random integer between 0 and n-1 (inclusively).
Random
(without a parameter) gives a pseudo random real between 0 (inclusively) and 1 (exclusively).
Frank