applets.

Letter Grid

← All apps

About Letter Grid

A tray of letter cubes, shaken so each lands in a square with one face up. You find words by joining letters that touch, across, down or diagonally, using each cube at most once in a word. Words need 3 letters or more.

PLAY: pick a size and a time, then SHAKE. The lid comes off, the cubes tumble into the tray and the sand starts to run. Type a word and press Enter, or drag across the cubes (on a phone, slide your finger) and let go. Each word is checked as you go: whether it's in the word lists, whether this grid can make it, and whether you already have it. When the sand runs out, or you press I'M DONE, the pad lists every word the page can find, with yours ringed. Tap any word to see its path. COPY LINK puts the grid in the address, so a friend can play the same one.

SOLVE: type the letters of a grid, row by row, for example from a game on the table (type Q for the Qu face). SOLVE lists every word, longest first.

THE MATHS: how many ways the cubes can land, how much of the search the prefix tree saves, and SEARCH, which hunts for high-scoring grids.

Scoring (this page's own): a word scores its length less two, so 3 letters is 1 point, 4 letters 2, 8 letters 6. Qu counts as the two letters it is.

THE STORY

Word games with letter cubes have been sold since the early 1970s: the best known, designed by Allan Turoff and first sold in 1972, puts 16 cubes in a tray with a lid and gives you three minutes on a sand timer. Like it, this page joins letters that touch and puts Q and U on one face, since a Q on its own is almost useless in English.

This page's cubes are its own, not a copy of any set on sale. The faces are shared out in proportion to how often each letter turns up in the site's common word list (each word counted once): every letter gets at least one face, and the rest go to the commoner letters, so the 16 cubes carry 10 Es, 8 Is, 8 Ss and one face each for F, J, K, Q (as Qu), V, W, X and Z. They are then dealt out so that no cube carries the same letter twice and the vowels are spread across the cubes. THE MATHS tab lists them. Counting letters in word lists rather than in ordinary text gives more S (plurals) and fewer H (ordinary text has a lot of "the").

HOW IT WORKS

The words come from the same lists as the site's Word Solver (SCOWL, British spellings): about 112,000 common words, then about 116,000 rarer ones, which count but are marked. The lists hold inflected forms (plurals, -ing, -ed), so a grid holds more words than you might expect. The page can only find words that are in the lists, and the lists include some odd words and leave out some real ones.

The solver is a depth-first search. From each cube it tries every unused neighbour, then every unused neighbour of that, and so on, carrying the letters so far. Walking every path would be slow: a 4 x 4 grid has 12,029,640 paths of touching, unrepeated cubes. So the words are first put into a prefix tree (a trie): one branch for each letter, shared by every word that starts the same way. The search follows the tree as it walks the grid, and as soon as the letters so far don't begin any word (no word starts DQ), it turns back. Most paths die after two or three cubes, so a whole grid takes a few milliseconds. THE MATHS tab counts how many steps the tree cut off.

The hunt for high-scoring grids is a hill-climb: start from a shake, make a small change (swap two cubes, or turn one to another face; or with ANY LETTERS, change a letter), keep it if the score doesn't drop, and start again from a fresh shake when it stops improving. It finds good grids, not the best possible one: nobody can check them all. Only the common words count towards the hunt's score.

FURTHER WATCHING AND READING

  • Wikipedia: Trie. The prefix tree the solver uses to give up on dead-end paths early.
LETTER GRID 16 cubes · press SHAKE to play
SIZE
TIME
3:00