1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-06 09:34:05 +00:00

Fix randomInt not being evenly distributed

This commit is contained in:
tobspr 2022-06-07 14:16:14 +02:00
parent 21e37792e0
commit 8c5118e41d

View File

@ -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);
}
/**