Mod
Random API
Provides a simple-to-use framework for selecting random objects with probabilities
This is a very small, simple-to-use API for selecting random items from a list with probabilities.
How to use
First, create a Random object using Random:new(), then add all your items using Random:add_choice(choice, probability), and finally, call Random:calc_csum().
When you want to get an item from the list, simply call Random:choose().
Links
- Source: https://github.com/nwdamgaard/random_api.git
- Forum: https://forum.luanti.org/viewtopic.php?t=23092
- Issues: https://github.com/nwdamgaard/random_api/issues
- Original ContentDB page: content.luanti.org/packages/TheFanne/random_api/
License
AGPL-2.0-only
| Version | Date | Min engine | Size | Download |
|---|---|---|---|---|
| 2019-08-20 | 2019-08-21 03:49:53 | 1.7 KB | Download |