MCPcopy Create free account
hub / github.com/Oslonline/dithering-studio / getRandomAlgorithm

Function getRandomAlgorithm

src/components/panels/AlgorithmSelect.tsx:19–23  ·  view source on GitHub ↗
(currentPattern?: number)

Source from the content-addressed store, hash-verified

17}
18
19export const getRandomAlgorithm = (currentPattern?: number): number => {
20 const availableAlgorithms = algorithms.filter(a => a.id !== currentPattern);
21 const randomIndex = Math.floor(Math.random() * availableAlgorithms.length);
22 return availableAlgorithms[randomIndex].id;
23};
24
25const AlgorithmSelect: React.FC<AlgorithmSelectProps> = ({
26 pattern,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected