- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for Example_rand (0.11 sec)
-
src/math/rand/v2/example_test.go
} fmt.Println("Magic 8-Ball says:", answers[rand.IntN(len(answers))]) } // This example shows the use of each of the methods on a *Rand. // The use of the global functions is the same, without the receiver. func Example_rand() { // Create and seed the generator. // Typically a non-fixed seed should be used, such as Uint64(), Uint64(). // Using a fixed seed will produce the same output on every run. r := rand.New(rand.NewPCG(1, 2))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Oct 30 17:09:26 UTC 2023 - 4.4K bytes - Viewed (0)