LLetterRook
AI coding workspace

Duplicate-aware letter feedback

LetterRook places text-game rules beside an AI conversation about your project. Ask a compatible model to explain duplicate handling and review its changes against words that exhaust a letter’s available count.

● ● ●LetterRook●
A concrete starting point · Duplicate-aware letter feedback ×
from collections import Counter

def letter_feedback(answer, guess):
    if any(type(s) is not str or len(s) != 5 or any(not "a" <= c <= "z" for c in s) for s in (answer, guess)):
        raise ValueError("word.lowercase")
    marks, remaining = [0] * 5, Counter()
    for i, (a, g) in enumerate(zip(answer, guess)):
        if a == g:
            marks[i] = 2
        else:
            remaining[a] += 1
    for i, g in enumerate(guess):
        if marks[i] != 2 and remaining[g]:
            marks[i] = 1
            remaining[g] -= 1
    return marks
✳Score a five-letter lowercase ASCII guess with 2 for exact, 1 for misplaced and 0 for absent letters.
✓ ChangesReview before applying ↗
Illustrative workspace
  1. Connection

    Base URL, credentials and a reachable server.

  2. Project

    Test repeated letters after reserving exact matches, rejecting uppercase, non-ASCII or wrong-length words.

  3. Review before applying

    Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.

Workflows

Duplicate-aware letter feedback

Workflows ↗
A concrete starting point
from collections import Counter

def letter_feedback(answer, guess):
    if any(type(s) is not str or len(s) != 5 or any(not "a" <= c <= "z" for c in s) for s in (answer, guess)):
        raise ValueError("word.lowercase")
    marks, remaining = [0] * 5, Counter()
    for i, (a, g) in enumerate(zip(answer, guess)):
        if a == g:
            marks[i] = 2
        else:
            remaining[a] += 1
    for i, g in enumerate(guess):
        if marks[i] != 2 and remaining[g]:
            marks[i] = 1
            remaining[g] -= 1
    return marks
AI coding workspace

Turn a game rule into a testable code change

LetterRook offers a Windows coding workspace for taking an informal game rule and making its software behavior precise. Open the project and give the connected model an example turn with the feedback you expect. Ask it to inspect the current scoring code and its caller before suggesting a change, especially when the reported problem depends on repeated symbols.

Five-letter feedback is a useful example task. A guess may contain more copies of a letter than the answer, so explain how exact matches affect the remaining feedback before asking for a patch. Review the proposed result against concrete pairs of words, not just the assistant's prose. The rules should determine the implementation and any explanation shown by your application.

Run fixtures that cover exact matches, repeated letters and rejected word forms after inspecting the edits. Check that the interface interprets the returned feedback consistently with the scoring contract. LetterRook connects to supported OpenAI-compatible or Anthropic endpoints, using credentials when needed. Choose an unfiltered model if your endpoint offers one; the server still determines context and tool support. Keeping an explicit turn and expected result in the conversation makes it easier to assess each suggested change without relying on a broad claim that the game now works.

From word examples to reliable feedback

What makes a useful bug report for repeated letters?

Provide the answer, the guess, actual feedback and expected feedback for each position. Include a case where exact matches consume some available letters. That gives the assistant a precise discrepancy to trace through the scoring implementation.

Why review exact matches before misplaced feedback?

The illustrated rule reserves exact matches before distributing remaining occurrences. A patch that counts every matching character independently can over-credit a repeated guess. Check the sequence in the source and retain examples that expose that mistake.

Should the scoring function accept uppercase words?

The existing example accepts five lowercase ASCII letters. If the application needs normalization, define where it occurs and test that boundary separately. Do not let a scoring fix silently introduce different accepted input forms.

What should the interface test add to scoring fixtures?

Confirm that each returned mark maps to the intended visible feedback and position. Correct internal numbers can still be presented incorrectly. Run that check alongside rule-focused fixtures after reviewing the relevant source changes.

Get the Windows app ↗

LetterRook · Updated 2026-10-25