Workshop › 15 Puzzle › Step 7 of 27
drawTile(number, x, y) draws a tile at a point. For now it is an orange square, and we try it on the first square.
```js
function drawTile(number, x, y) {
ctx.fillStyle = '#f59e0b'
ctx.fillRect(x, y, SIZE, SIZE)
}
function draw() {
ctx.fillStyle = '#292524'
ctx.fillRect(0, 0, canvas.width, canvas.height)
drawTile(1, squareX(0), squareY(0))
}
```number, x and y are parameters: the values given in the call. number is not used yet.SIZE by SIZE orange square with its top-left corner at x, y.drawTile(1, squareX(0), squareY(0)) draws tile 1 on square 0: at (11, 60).function draw() {, write drawTile and leave an empty line.draw, under the fillRect line, leave an empty line and write the drawTile(...) call. Press Run.Skills: Drawing on a canvas, Functions
← Where each square is The number on the tile →