Wordle comparison: Difference between revisions

m
(J: improve test cases)
Line 182:
<tt><nowiki><I.x=y</nowiki></tt> is a box containing the list of exact match indices, and <tt><nowiki>(<@I.y=/~x#~y~:x)</nowiki></tt> is a list of boxes (for each character) of the indices of non-exact matches. Meanwhile <tt><nowiki>({.~1<.#)</nowiki></tt> means "at most one" and operates on lists (so it's empty for an empty list and the first element for a non-empty list).
 
In other words, we build a list of candidate matches for each character and then, for each character, exclude any already picked index and if there's a remaining candidatecandidates, we pick thatthe indexfirst of those.
 
(exact match indices will override inexact match indices, which makes the inexact match index calculation simpler -- we don't have to use a separate type for exact match indices.)
6,951

edits