Wordle comparison: Difference between revisions
Content added Content deleted
m (J: eliminate redundant test) |
m (→{{header|J}}) |
||
Line 179: | Line 179: | ||
Explanation: |
Explanation: |
||
<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 |
<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 (one box for each character in the guess) of the indices of not-necessarily-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 candidates, we pick the first of those. |
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 candidates, we pick the first of those. |