A TypeScript module for random events and gacha (random sampling with weights).
-
Updated
Jun 4, 2025 - TypeScript
A TypeScript module for random events and gacha (random sampling with weights).
A weighted random item sampler (selector), where the probability of selecting an item is proportional to its weight, and every item is sampled exactly once (without repetition or replacement). The sampling method utilizes a binary-search optimization, making it suitable for performance-demanding applications where the set of items is large.
To associate your repository with the weighted-random-choice topic, visit your repo's landing page and select "manage topics."