Workshop › Minesweeper › Step 18 of 26
A hidden flagged cell shows a 🚩.
```js
} else {
ctx.fillStyle = '#94a3b8'
ctx.fillRect(x + 1, y + 1, CELL - 2, CELL - 2)
if (cell.flagged) ctx.fillText('🚩', x + CELL / 2, y + CELL / 2 + 1)
}
```In the else block of the cell loop, under its fillRect, write the flag line. Press Run and right-click cells.
Skills: Drawing on a canvas
← A flag protects its cell Mines left →