MCPcopy Index your code
hub / github.com/DavidHDev/react-bits / rand

Function rand

src/tools/texture-lab/Controls.jsx:2108–2108  ·  view source on GitHub ↗
(min, max)

Source from the content-addressed store, hash-verified

2106// "Randomize parameters". Keys and ranges must match each effect's real params.
2107const randomizeParamsForType = type => {
2108 const rand = (min, max) => Math.random() * (max - min) + min;
2109 const randInt = (min, max) => Math.floor(rand(min, max + 1));
2110 const randBool = () => Math.random() > 0.5;
2111 const randChoice = arr => arr[Math.floor(Math.random() * arr.length)];

Callers 2

randIntFunction · 0.70
randomizeParamsForTypeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected