0

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.

4
  • 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.js
    Commented 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. Commented Mar 15, 2023 at 12:23
  • You can use Switchboard VRF to get random no as well
    – Pratik.js
    Commented Mar 15, 2023 at 12:29
  • There is an awesome detailed blogpost on this topic here daoplays.org/blog/random_numbers
    – chalda
    Commented Mar 16, 2023 at 16:40

0

Browse other questions tagged or ask your own question.