@ronin_jjj/randomize
v2.0.1
Published
Easily randomize values from a simple 50-50 percentage to more advanced percentages!
Downloads
2
Readme
randomize
Easily randomize values from a simple 50-50 percentage to more advanced percentages!
import randomize from "@ronin_jjj/randomize"
randomize({
heads: 50, //50%
tails: 50
}) // "heads" | "tails"
randomize({
bronze: 70, //70%
silver: 20,
gold: 10
}) // "bronze" | "silver" | "gold"
randomize({
fail: 60.4, // 60.4%
succeed: 39.5,
jackpot: 0.1
}) // "fail" | "succeed" | "jackpot"