Workshop › Bomberman-style Arena › Step 8 of 42
If the player started boxed in by crates, their first bomb would have no escape. So the tiles next to the start corners (the player's at row 1, column 1 and three for the enemies) are always floor.
```js
const ENEMY_STARTS = [[ROWS - 2, COLS - 2], [1, COLS - 2], [ROWS - 2, 1]]
const near = (r, c, spots) => spots.some(([sr, sc]) => Math.abs(sr - r) + Math.abs(sc - c) <= 1)
// Walls all round, a pillar on every even row and column, and crates on about half of the rest,
// but never next to where the player and the enemies start.
function makeGrid() {
else if (near(r, c, [[1, 1], ...ENEMY_STARTS]) || Math.random() > 0.55) grid[r].push(' ')
```ENEMY_STARTS lists the enemies' corners as [row, column].near(r, c, spots) is true if (r, c) is at most one step from any spot. some asks "is it true for at least
one?"; ([sr, sc]) unpacks each spot.[[1, 1], ...ENEMY_STARTS] spreads the three enemy corners next to the player's: one list of four spots.TOP write ENEMY_STARTS.let grid, after an empty line, write near.function makeGrid() { write the two comment lines.makeGrid, put near(r, c, [[1, 1], ...ENEMY_STARTS]) || before Math.random() > 0.55.Skills: Arrays and objects, Functions