MultiplayerMinesweeper/scripts/util.mjs

7 lines
198 B
JavaScript

export function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
export function clamp(number, min, max) {
return Math.max(min, Math.min(number, max));
}