Workshop › Sudoku › Step 5 of 28
The board will change as you play, so it is redrawn every frame by a loop.
```js
function loop() {
draw()
requestAnimationFrame(loop)
}
reset()
requestAnimationFrame(loop)
```requestAnimationFrame(loop) runs loop again before the next screen refresh, about 60 times a second.Replace the draw() call at the bottom with loop and requestAnimationFrame(loop).
Skills: The game loop
← The puzzle's own digits The selected cell →