Word Matrix
Interactive word search puzzle generator. Find hidden words in a letter matrix with multiple difficulty levels and 8-directional word placement.
About
A word search matrix conceals n words inside a grid of R ร C cells. Each word occupies a straight line along one of 8 compass directions. The remaining cells are filled with decoy letters weighted by English frequency distribution, where e appears at 12.7% and z at 0.07%. This frequency matching prevents solvers from using letter rarity as a shortcut. Incorrect grid generation can produce unsolvable puzzles when word collisions go unchecked. This tool uses backtracking placement with collision validation to guarantee every puzzle is solvable.
Difficulty controls more than grid size. Easy mode restricts placement to 2 axes (horizontal and vertical). Hard mode enables all 8 directions including reversed diagonals, increasing search complexity from O(2n) to O(8n) per word. The tool tracks completion state and selection accuracy. Note: word placement is randomized per generation. Two puzzles with identical settings will differ.
Formulas
Word placement uses direction vectors. Each of the 8 directions is encoded as a pair (dr, dc):
A word of length L placed at origin (r0, c0) occupies cells:
Placement validity requires all cells within bounds 0 โค r < R and 0 โค c < C, and each cell either empty or already containing the matching letter (collision sharing). Fill letters use weighted random selection where probability of letter k is:
Where fk is the English corpus frequency of letter k. This produces natural-looking fill that resists frequency analysis solving strategies.
Reference Data
| Letter | English Frequency | Letter | English Frequency | Letter | English Frequency |
|---|---|---|---|---|---|
| E | 12.70% | I | 6.97% | D | 4.25% |
| T | 9.06% | S | 6.33% | L | 4.03% |
| A | 8.17% | H | 6.09% | C | 2.78% |
| O | 7.51% | R | 5.99% | U | 2.76% |
| N | 6.75% | W | 2.36% | M | 2.41% |
| F | 2.23% | Y | 1.97% | G | 2.02% |
| P | 1.93% | B | 1.29% | V | 0.98% |
| K | 0.77% | J | 0.15% | X | 0.15% |
| Q | 0.10% | Z | 0.07% | - | |