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

Function simulate

frontend/src/components/Simulate.tsx:33–40  ·  view source on GitHub ↗
(ballManager: BallManager)

Source from the content-addressed store, hash-verified

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

Callers 1

SimulateFunction · 0.70

Calls 2

padFunction · 0.90
addBallMethod · 0.80

Tested by

no test coverage detected