MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / randomInt

Function randomInt

plugins/math.js:99–103  ·  view source on GitHub ↗
(from, to)

Source from the content-addressed store, hash-verified

97 return { str: `${a} ${operators[op]} ${b}`, mode, time, result };
98}
99function randomInt(from, to) {
100 if (from > to)
101 [from, to] = [to, from];
102 return Math.floor(Math.random() * (Math.floor(to) - Math.ceil(from) + 1) + Math.ceil(from));
103}
104function pickRandom(list) {
105 return list[Math.floor(Math.random() * list.length)];
106}

Callers 1

genMathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected