rpg
// 用法
randBox.rpg('#d#')
randBox.rpg('#d#', {sum: true})
给定一个看起来像 #d# 的输入,其中第一个 # 是要投掷的骰子数量,第二个 # 是每个骰子的最大值,返回一个骰子值数组。
randBox.rpg('3d10');
=> [1, 6, 9]
randBox.rpg('5d6');
=> [3, 1, 2, 5, 2]
可选择指定返回总和而不是骰子数组。
randBox.rpg('3d10', {sum: true});
=> 14
最后更新于: