Workshop › 15 Puzzle › Step 25 of 27
On a solved board, a click or Space shuffles a new puzzle.
```js
canvas.addEventListener('pointerdown', (event) => {
if (state === 'solved') {
reset()
return
}
// ...
if (event.key === ' ' && state === 'solved') reset()
})
```reset() and returns, so it does not also try to move a tile.' '.pointerdown listener, write the if block at the very top.keydown listener, under the arrow if block, write the Space line. Press Run.Skills: Keyboard and mouse input
← Show the win A record to beat →