Fix randomInt not being evenly distributed
This commit is contained in:
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…
Reference in New Issue