odin-js-fundamentals-part-5/node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js

13 lines
482 B
JavaScript
Raw Normal View History

2024-01-11 08:52:05 +00:00
import { unsafeUniformArrayIntDistribution } from './UnsafeUniformArrayIntDistribution.js';
function uniformArrayIntDistribution(from, to, rng) {
if (rng != null) {
var nextRng = rng.clone();
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
}
return function (rng) {
var nextRng = rng.clone();
return [unsafeUniformArrayIntDistribution(from, to, nextRng), nextRng];
};
}
export { uniformArrayIntDistribution };