Fix randomInt not being evenly distributed

This commit is contained in:
tobspr 2022-06-07 14:16:14 +02:00
parent 21e37792e0
commit 8c5118e41d
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ export function newEmptyMap() {
* @param {number} end * @param {number} end
*/ */
export function randomInt(start, end) { export function randomInt(start, end) {
return start + Math.round(Math.random() * (end - start)); return Math.floor(Math.random() * (end - start + 1) + start);
} }
/** /**