Phaser AE

Word ladders

Pro packv3.0.0-0WordNew

Turn COLD into WARM one letter at a time: cord, card, ward, warm. Every step must be a real word, and the fewer steps the better. The pack makes the puzzles, checks the steps and always knows the shortest way to the goal.

This is a Pro pack. Upgrade to Phaser Pro to use it in your games.See Phaser Pro →

Released October 21, 2026

Word ladders: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

The pack

wordLadder

function wordLadder(): Pack<{ wordLadder: WordLadderApi }>

The word-ladder pack: word ladder puzzles over the english-words lists. Pure logic, so it runs headless.

Helpers

createWordLadder

function createWordLadder(options: WordLadderOptions): WordLadder

Make a ladder: a generated puzzle from seed, or the one start and goal set. Throws a RangeError for options out of range: a set word not in the list or not reachable, a step range with no puzzle in it, a limit below par.

ladderNeighbours

function ladderNeighbours(word: string, words: WordList = englishLexicon(), moves: LadderMoves = 'change'): string[]

Every word one step from word in words (default the English lexicon) under moves (default 'change'): one letter changed, or with 'edit' also one added or taken away. Shortest first, then alphabetical; word itself is left out, and it need not be in the list. Empty for anything but letters.

solveLadder

function solveLadder(start: string, goal: string, words: WordList = englishLexicon(), moves: LadderMoves = 'change', avoid: Iterable<string> = []): string[] | null

A shortest ladder from start to goal in words (default the English lexicon) under moves (default 'change'), both ends included, never through a word in avoid; null when there is none. Ties go to the alphabetically first words, so the answer is always the same. Neither end need be in the list.

Types

LadderMoves

type LadderMoves = 'change' | 'edit'

What one step may do: 'change' one letter (the length stays), or 'edit': change, add or take away one letter.

LadderRung

interface LadderRung

One word on the ladder, and where it changed.

  • readonly word: string — The word, lower case.
  • readonly changed: ReadonlyArray<number> — The positions in word that differ from the rung before: the changed letter, or an added one. Empty for the start word and for a step that took a letter away.

StepResult

interface StepResult

What a step did.

  • readonly rung: LadderRung — The rung it added.
  • readonly phase: WordLadderView['phase'] — The phase after it.
  • readonly remaining: number | null — The fewest steps left to the goal from the new word, or null when there is no way.

WordLadder

interface WordLadder

A word ladder. Make one with createWordLadder.

  • observation(): WordLadderView — The ladder as it stands.
  • check(word: string): { readonly ok: true } | Refusal — Would a step to word be accepted now? { ok: true }, or the refusal with a reason a player could be shown. Changes nothing.
  • step(word: string): { readonly ok: true; readonly result: StepResult } | Refusal — Step to word. Refused, changing nothing, when check would refuse it.
  • undo(): boolean — Take back the last step. False when there is none.
  • hint(): { readonly word: string | null; readonly remaining: number | null; readonly reason: string } — The next word on a shortest way from the last word to the goal, not using a word on the ladder again; null when there is none or the ladder is over.
  • autoStep(): { readonly ok: true; readonly result: StepResult } | Refusal — Play hint()'s word. Refused when there is none.
  • solve(from?: string): string[] | null — A shortest ladder to the goal, as words with both ends: from the last word avoiding the words already on the ladder (no argument), or from any word in the list (from). Null when there is no way.
  • snapshot(): HistorySave<WordLadderMove> — The ladder as a save: the seed and the steps. Restore it into a ladder made with the same options.
  • restore(save: HistorySave<WordLadderMove> | string): void — Replace this ladder's steps with a save. Throws, changing nothing, when the save does not replay.

WordLadderApi

type WordLadderApi = typeof rules

game.wordLadder: every function and type this pack carries, as one namespace.

WordLadderMove

type WordLadderMove = { … }

A move: one step to a word.

  • readonly kind: 'step'
  • readonly word: string

WordLadderOptions

interface WordLadderOptions

How a ladder is set up. Only seed is required; the default is a four-letter puzzle of 3 to 6 steps.

  • seed: number — Picks the puzzle when start and goal do not set it, as an unsigned 32-bit integer.
  • length?: number — Letters in a generated puzzle's start and goal. Default 4, or the length of start.
  • minSteps?: number — Fewest steps the shortest ladder of a generated puzzle may take. Default 3.
  • maxSteps?: number — Most steps the shortest ladder of a generated puzzle may take. Default 6.
  • start?: string — The start word of a set puzzle; give goal with it. Must be in the word list.
  • goal?: string — The goal word of a set puzzle; give start with it. Must be in the word list and reachable.
  • words?: WordList — The words a step may be. Default the English lexicon.
  • moves?: LadderMoves — What one step may do. Default 'change'.
  • limit?: number — Most steps allowed before the ladder is lost: a whole number no smaller than the puzzle's par, or Infinity (the default).
  • attempts?: number — Start words tried when generating. Default 60.

WordLadderView

interface WordLadderView

The ladder as it stands.

  • readonly phase: 'playing' | 'won' | 'lost' — 'playing', 'won' (the goal is reached) or 'lost' (the step limit is used up).
  • readonly start: string — The start word.
  • readonly goal: string — The goal word.
  • readonly rungs: ReadonlyArray<LadderRung> — Every word so far, the start first.
  • readonly par: number — The fewest steps from the start to the goal.
  • readonly remaining: number | null — The fewest steps from the last word to the goal without using a word on the ladder again; null when there is no way. 0 once won.
  • readonly steps: number — Steps taken.
  • readonly limit: number — Most steps allowed; Infinity for no limit.
  • readonly moves: LadderMoves — What one step may do.