Workshop › Blackjack › Step 5 of 22
Each card is a white rectangle with a thin dark border. A hand is drawn as a row of cards, 8 pixels apart: the dealer's at the top, yours below.
```js
const CARD_W = 64
const CARD_H = 90
const DEALER_Y = 70
const PLAYER_Y = 250
function drawCard(c, x, y) {
ctx.fillStyle = '#ffffff'
ctx.fillRect(x, y, CARD_W, CARD_H)
ctx.strokeStyle = '#0f172a'
ctx.lineWidth = 1
ctx.strokeRect(x, y, CARD_W, CARD_H)
}
function drawHand(hand, y) {
hand.forEach((c, i) => drawCard(c, 20 + i * (CARD_W + 8), y))
}
drawHand(dealer, DEALER_Y)
drawHand(player, PLAYER_Y)
```strokeRect draws only the outline of a rectangle, in strokeStyle.forEach((c, i) => ...) gives each card with its position in the hand; card i is i × 72 pixels to the right.SUITS, write the four size and position constants.draw, write drawCard and drawHand.draw, draw both hands after the table.Skills: Drawing on a canvas