I’m gonna design a random algorithm to draw a random number from an array.
In the others advanced language, there is a random function of math to achieve this goal(like Math. random () function). But I’m not sure that solidity has the same function. I didn’t find any from the safemath contract at least.
I know maybe it is not smart to deal with math in a smart contract. But I’m just considering the possibilities. So,
- can anyone help design a random algorithm to pick a number from an array?
- Or design a random array instead of picking a random number from a fixed array.