MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / getRandomIntegers

Function getRandomIntegers

snake-dqn/utils.js:41–47  ·  view source on GitHub ↗
(min, max, numIntegers)

Source from the content-addressed store, hash-verified

39 * @return {number[]} The random integers.
40 */
41export function getRandomIntegers(min, max, numIntegers) {
42 const output = [];
43 for (let i = 0; i < numIntegers; ++i) {
44 output.push(Math.floor((max - min) * Math.random()) + min);
45 }
46 return output;
47}
48
49
50export function assertPositiveInteger(x, name) {

Callers 1

utils_test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected