ForHosting KIT · Home, food & hobbies

Check a Valid Word Ladder Step

Cold to cord is a valid word ladder move because only the third letter changes; the checker counts every difference and shows its position, so a broken step is easy to explain. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Word a
cold
Word b
cord
You get
Differences
1
Differing positions
3

A word ladder changes one word into another through a sequence of small moves, with exactly one letter replaced at each move. This checker evaluates one proposed move: provide two words of equal length, and it reports whether exactly one character position differs. It also returns the number and one-based positions of all differences, making an invalid result easy to explain. The comparison is deterministic and case-sensitive, and unequal lengths are rejected as input errors rather than treated as ordinary invalid moves.

Provide the two words exactly as they should be compared

Both values must be non-empty strings containing the same number of characters. The checker preserves the input exactly: it does not trim spaces, convert uppercase letters to lowercase, remove punctuation, apply Unicode normalization, or consult a dictionary. That strict behavior is useful when the surrounding game or application already controls its accepted vocabulary.

For example, <code>cold</code> and <code>cord</code> have equal length and differ only in the third position, so they form a valid step. By contrast, <code>Cold</code> and <code>cold</code> also differ at one position because comparison is case-sensitive. If your game should ignore case, normalize both inputs consistently before calling the capability.

Equal length is a structural requirement, not part of the verdict. Insertions and deletions belong to edit-distance problems, not this word-ladder check.

Understand the verdict and diagnostic fields

One-based positions match the way people usually count letters in a word: position 1 is the first character. Identical words produce a normal result with zero differences and <code>valid</code> set to false, because a ladder step must actually change one letter. Two or more substitutions also produce a normal false result and expose every mismatching position.

Only malformed values, missing fields, empty strings, or unequal lengths produce an input error. This separation lets callers distinguish a well-formed but illegal move from a request that cannot be evaluated.

Use the check inside a complete word-ladder workflow

This capability verifies the shape of one move; it deliberately does not decide whether either input is a recognized word. A complete game normally performs two independent checks: first confirm that the proposed word belongs to the chosen dictionary, language, or puzzle vocabulary, then confirm here that the transition changes exactly one position. Keeping those responsibilities separate avoids hidden assumptions about proper nouns, regional spellings, accented characters, inflections, or specialist terms.

In an interactive game, call the checker after a player submits a move and use the returned position to highlight the changed letter. In a puzzle authoring tool, run it across every adjacent pair in a proposed solution chain to locate broken links. In automated tests, assert both the verdict and mismatch positions so a failing chain explains itself.

The pure implementation uses no network, random source, clock, storage, or external model.

Validate a player's move

Confirm that the proposed next word changes exactly one character before adding it to the active ladder.

Audit a puzzle solution

Check every neighboring pair in a prepared word chain and identify the exact positions behind invalid links.

Test word-game software

Use deterministic mismatch counts and positions as assertions for move validation, highlighting, and error-message logic.

Does the checker verify that both inputs are real words?

No. It checks only the one-position substitution rule. Validate dictionary membership separately using the vocabulary appropriate to your game.

What happens when the words have different lengths?

Standard word-ladder steps replace one character and do not insert or delete characters.

Are uppercase and lowercase letters treated as equal?

No. Comparison is case-sensitive, so an uppercase character and its lowercase counterpart count as different. Normalize inputs first if your rules ignore case.

Are identical words a valid step?

No. Identical words have zero differences, while a valid step requires exactly one differing position.

How are differing positions numbered?

Positions are one-based: 1 means the first character, 2 means the second, and so on.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/game/word-ladder-step-check

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/game/word-ladder-step-check \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"word_a":"cold","word_b":"cord"}'
{
  "word_a": "cold",
  "word_b": "cord"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "game.word_ladder_step_check",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Provide the two words exactly as they should be compared

Enter the starting word in <code>word_a</code> and the proposed next word in <code>word_b</code>. When the lengths differ, the request returns an input error because the words cannot be compared position by position under the standard substitution-only rule.

Understand the verdict and diagnostic fields

The response contains <code>valid</code>, <code>differences</code>, and <code>differing_positions</code>. The Boolean <code>valid</code> is true only when the mismatch count is exactly one. The <code>differences</code> value gives the total number of positions where the characters are different, while <code>differing_positions</code> lists those positions using one-based numbering. The algorithm scans the pair once from left to right, so output order is stable and repeated calls with the same input always return the same JSON values.

Use the check inside a complete word-ladder workflow

It can therefore run locally in the browser for quick checks, while automated systems can invoke the API for $0.002 per request and receive the same deterministic result.

What does an API request cost?

Each API request costs $0.002. The interactive browser version runs locally for free.

Read the full KIT documentation →