"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.chance = exports.randomMatrix = exports.randomIntegerBetween = exports.randomBetween = void 0;
function randomBetween(a, b) {
    return a + (b - a) * Math.random();
}
exports.randomBetween = randomBetween;
function randomIntegerBetween(a, b) {
    return Math.floor(randomBetween(a, b));
}
exports.randomIntegerBetween = randomIntegerBetween;
function randomMatrix(rows, columns, generator) {
    const matrix = [];
    for (let i = 0; i < rows; i++) {
        matrix[i] = [];
        for (let j = 0; j < columns; j++) {
            matrix[i][j] = generator(i, j);
        }
    }
    return matrix;
}
exports.randomMatrix = randomMatrix;
function chance(chance = 0.5) {
    return Math.random() <= chance;
}
exports.chance = chance;
//# sourceMappingURL=math.js.map