Workshop › Conway's Game of Life › Step 29 of 32
A 'Gun' button clears the world and stamps the gun near the top left; the G key presses it.
```js
else if (button === 'Clear') clear()
else if (button === 'Gun') {
clear()
stamp(GUN, 4, 4)
}
}
const keys = { ' ': 'Play', n: 'Step', r: 'Random', c: 'Clear', g: 'Gun' }
```'Gun' first clears (empty and stopped), then stamps GUN with its top left corner at row 4, column 4.g: 'Gun' in the table makes the G key press it.press, under the 'Clear' line, add the 'Gun' case (four lines).g: 'Gun' to the key table.Skills: Keyboard and mouse input
← The glider gun Buttons on the screen →