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

6 lines
191 B
TypeScript
Raw Normal View History

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