MultiplayerMinesweeper/util.js

8 lines
217 B
JavaScript
Raw Normal View History

2022-04-20 18:53:36 +00:00
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min) + min);
}
2022-04-21 03:23:51 +00:00
function clamp(number, min, max) {
return Math.max(min, Math.min(number, max));
}
module.exports = {randomNumber, clamp}