What it does
createWordChain starts a game from a seed. Each word must start with the last letter of the word before, or the last
two, or any number you choose, be in the word list, be long enough and be new; anything else is refused with a reason
a player can be shown. A word scores a point a letter. A turn has a clock that runs on game time: when it runs out, or
a player passes, they lose a life, and a player with none is out. When a chain reaches a dead end, with no unplayed
word starting the right way, the player stuck there loses a life and the next player gets a fresh start letter.
Computer seats play at three difficulties. An easy computer plays short words and is sometimes stumped; a medium one
plays any word; a hard one plays the word that leaves the next player the fewest answers, so it steers the chain
towards dead ends. hint offers the shortest word that fits, and answersLeft says how many words still start with
the letters in play.
Every game is a seed and a list of moves on the kernel history, time included, so saves and replays come with it, and undo takes back a word without giving back the time.
Features
- Link rules — the last letter, the last two, or any number of letters.
- No repeats — every word in the chain is checked against those played.
- A clock — seconds a turn on game time, or none; a timeout costs a life and passes.
- Lives and knockouts — a player with no lives is out; the last one in wins.
- Dead ends — a stuck player loses a life and the chain restarts on a fresh, seeded letter.
- Computer players — easy, medium and hard, the hardest playing to trap you.
- Solo chains — one player, as long a chain as they can make.
- Themed lists — any word list or array: animals, countries, this week's spelling words.
- Hints — the shortest word that fits, and how many answers are left.
- Saves and undo — the kernel history of moves.
Good for
- A quick duel against the computer, three lives and fifteen seconds a turn.
- Party and classroom games, two to eight players passing one device.
- Solo challenges, the longest chain before the lives run out.
- Category games, only animals, only countries, only words from a lesson.
- Harder variants, linking by the last two or three letters with longer words.
Make it yours
A game takes its players and which are bots, the computer's difficulty, the link, minLength, timePerTurn,
lives, the words and a startLetter. The pack draws nothing, so the chain, the clock and the players' hearts are
yours.
Two materially different games from the same pack: a solo chain of animals with one life and twenty seconds a turn, where the challenge is the length; and a three-player duel, two of them hard computers, where every word must start with the last two letters of the one before and be at least four letters long.
A quick look
A game against the computer, played from the step:
const game = createWordChain({ seed, players: ['You', 'Computer'], bots: [1], difficulty: 'hard' });
game.check('camel'); // { ok: true } or { ok: false, reason }
game.play('camel'); // the next word must start with L
game.advance(dt); // from the game's step: a turn that runs out costs a life
if (game.observation().players[game.observation().current].bot) game.autoStep();
Works with
english-words— required: the default word list and the lists for category games.letter-tiles— draws the chain as rows of tiles, the word being typed and an on-screen keyboard.word-guess— when the game is about guessing one hidden word instead.
Good to know
- It is the rules only: the game draws the chain and calls
advancefrom its step. - The English lexicon has no word frequencies, so an easy computer plays short words rather than common ones.
- A dead end counts words a person may not know, so a chain can feel stuck before the pack calls it one.
- Local play only; a networked game sends its moves to
playitself.






