Workshop › Wordle-style Word Guess › Step 1 of 26
Guess the five-letter word in six tries, with green, yellow and gray hints. Keyboard input, string handling, the scoring rules for repeated letters, an on-screen keyboard for phones and saved statistics.
A word game like Wordle: guess the secret five-letter word in six tries; after every guess, colours show which letters
are right. Everything is drawn on the page's <canvas>, so first we find it and take its 2D drawing tools.
```js
const canvas = document.getElementById('game')
const ctx = canvas.getContext('2d')
```document.getElementById('game') finds the element whose id is game; const canvas = names it.canvas.getContext('2d') gives the canvas's 2D drawing tools; we call them ctx.Write the two lines under the three comment lines, then press Run.
Skills: Drawing on a canvas