kun-galgame-vue/src/utils/randomNum.ts

6 lines
181 B
TypeScript
Raw Normal View History

2023-06-09 17:03:06 +00:00
// 生成指定范围内的随机数
export default (lowerValue: number, upperValue: number) => {
return Math.floor(Math.random() * (upperValue - lowerValue + 1) + lowerValue)
}