MCPcopy Create free account
hub / github.com/code100x/plinkoo / simulate

Function simulate

frontend/src/components/Simulation.tsx:30–37  ·  view source on GitHub ↗
(ballManager: BallManager)

Source from the content-addressed store, hash-verified

28 });
29
30 async function simulate(ballManager: BallManager) {
31 let i = 0;
32 while (1) {
33 i++
34 ballManager.addBall(pad(WIDTH / 2 + 20 * (Math.random() - 0.5)))
35 await new Promise(resolve => setTimeout(resolve, 1000));
36 }
37 }
38
39 useEffect(() => {
40 if (canvasRef.current) {

Callers 1

SimulationFunction · 0.70

Calls 2

padFunction · 0.90
addBallMethod · 0.80

Tested by

no test coverage detected