Random API

Provides a simple-to-use framework for selecting random objects with probabilities

API / Library

Download (2 KB)

How do I install this?

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

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.