Fix randomInt not being evenly distributed

pull/1434/head
tobspr 2 years ago
parent 21e37792e0
commit 8c5118e41d

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

Loading…
Cancel
Save