I'd like to know the way to get a lot of random numbers in a function on Solana Rust program. I know the way to get random number in a function but not sure if it works to get multiple numbers.
-
Why not use the same way you used to generate random number for one function using the same logic to get multiple random number in that function itself– Pratik.jsCommented Mar 15, 2023 at 11:57
-
The RNG function used the block timestamp to generate the random number, so in a function, the all numbers are same.– Doublers KayCommented Mar 15, 2023 at 12:23
-
You can use Switchboard VRF to get random no as well– Pratik.jsCommented Mar 15, 2023 at 12:29
-
There is an awesome detailed blogpost on this topic here daoplays.org/blog/random_numbers– chaldaCommented Mar 16, 2023 at 16:40
Add a comment
|