wordList
array
A large list of valid 5-letter words that the game randomly picks from as the secret target word.
let wordList = ["apple", "beach", ...];
boxes
array
A 2D array (6 rows x 5 columns) of Box objects representing every letter tile on the game board.
let boxes = [[], [], [], [], [], []];
currentRow
number
Tracks which row (guess attempt, 0-5) the player is currently filling in.
let currentRow = 0;
currentBox
number
Tracks which box (letter position, 0-4) within the current row the player is currently typing into.
let currentBox = 0;
targetWord
string
Stores the randomly chosen secret word (in uppercase) that the player is trying to guess.
let targetWord = "";
wrong
boolean
Becomes true once the player has used all 6 attempts without guessing correctly, ending the game in a loss.
let wrong = false;
won
boolean
Becomes true the moment the player's guess exactly matches the target word, ending the game in a win.
let won = false;
keypad
array
A flat array of Key objects representing every button on the on-screen QWERTY keyboard.
let keypad = [];
keypadRows
array
Defines the letters in each of the three keyboard rows, used to lay out the keypad in setupKeypad().
const keypadRows = ["QWERTYUIOP", "ASDFGHJKL", "ZXCVBNM"];
UNTESTED_COLOR
string
The default gray hex color for boxes/keys that haven't been scored yet.
const UNTESTED_COLOR = '#818384';
GRAY_COLOR
string
The hex color used to mark a letter that isn't in the target word at all.
const GRAY_COLOR = '#3a3a3c';
YELLOW_COLOR
string
The hex color used to mark a letter that's in the target word but in the wrong position.
const YELLOW_COLOR = '#b59f3b';
GREEN_COLOR
string
The hex color used to mark a letter that's in exactly the right position.
const GREEN_COLOR = '#538d4e';