Workshop › Bomberman-style Arena › Step 6 of 42
Inside the arena, every tile whose row and column are both even is a pillar. That checkerboard of pillars makes the classic corridors: flames and players travel only in straight lines between them.
```js
if (r === 0 || c === 0 || r === ROWS - 1 || c === COLS - 1 || (r % 2 === 0 && c % 2 === 0)) grid[r].push('#')
```% is the remainder of a division: r % 2 === 0 asks "is r even?".&& means "and": both the row and the column must be even.In makeGrid, add || (r % 2 === 0 && c % 2 === 0) at the end of the wall condition.
Skills: Arrays and objects
← Draw what the grid says Crates →