Skip to main content

rand_from_seed

Function rand_from_seed 

pub fn rand_from_seed(seed: i64) -> PackedArray<i64>
Expand description

Given a seed, returns a PackedInt64Array of size 2, where its first element is the randomized int value, and the second element is the same as seed. Passing the same seed consistently returns the same array.

Note: “Seed” here refers to the internal state of the pseudo random number generator, currently implemented as a 64 bit integer.

var a = rand_from_seed(4)

print(a[0]) # Prints 2879024997
print(a[1]) # Prints 4