Skip to main content

seed

Function seed 

pub fn seed(base: i64)
Expand description

Sets the seed for the random number generator to base. Setting the seed manually can ensure consistent, repeatable results for most random functions.

var my_seed = "Godot Rocks".hash()
seed(my_seed)
var a = randf() + randi()
seed(my_seed)
var b = randf() + randi()
# a and b are now identical