Go to file
Nathan Damgaard fcbd4d2f81 Add README 2019-08-20 20:45:57 -07:00
README.md Add README 2019-08-20 20:45:57 -07:00
init.lua multiple instances of Random actually works now 2019-08-20 20:43:55 -07:00
mod.conf Initial commit 2019-08-15 21:06:48 -07:00

README.md

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().