I'm trying to do weighted random numbers using a random number returned from Chainlink VRFv2. Let's say I was minting 10,000 NFTs and wanted to assign a random trait to each one during mint with percentage weights -- would this be the best approach or is there a better way that would save more on gas? pseudo-code:
function fulfillRandomWords(uint256[] memory randomWords) {
uint256 memory rand = randomWords[0] % 1000;
if (rand > 0 && rand < 100) // 10% chance
if (rand > 100 && rand < 300) // 20% chance
// and so on...
}