Comment by mitxela
4 days ago
Example: to get a number between 0-2 (3 values) with a 4-bit RNG (16 values, 0-15) you can split the set 0-14 into 3 groups of 5 (doesn't matter if you use modulus or divide) but if you get 15 you need to re-roll.
4 days ago
Example: to get a number between 0-2 (3 values) with a 4-bit RNG (16 values, 0-15) you can split the set 0-14 into 3 groups of 5 (doesn't matter if you use modulus or divide) but if you get 15 you need to re-roll.
No comments yet
Contribute on Hacker News ↗