Workshop › Wordle-style Word Guess › Step 16 of 26
Each finished guess is drawn as full tiles in its marks' colours, with white letters. Typing goes into the row after the last guess.
```js
const COLORS = { green: '#16a34a', yellow: '#ca8a04', gray: '#3f3f46' }
for (let row = 0; row < TRIES; row++) {
const guess = guesses[row]
const letters = guess ? guess.word : row === guesses.length ? current : ''
if (guess) {
ctx.fillStyle = COLORS[guess.marks[i]]
ctx.fillRect(x, y, SIZE, SIZE)
} else {
ctx.strokeStyle = letters[i] ? '#a1a1aa' : '#3f3f46'
ctx.lineWidth = 2
ctx.strokeRect(x + 1, y + 1, SIZE - 2, SIZE - 2)
}
```COLORS maps a mark to a colour: COLORS['green'] is '#16a34a'.guess is this row's finished guess, or undefined if there is none yet.letters: the guess's word on a finished row; the typed letters on the first empty row (row === guesses.length);
nothing below.const TOP = 12, write COLORS.draw, replace the letters line with the two lines shown.if (guess) { ... } else { ... } as shown. Press Run and send a guess.Skills: Drawing on a canvas
← Enter sends the guess Winning and losing →