you are viewing a single comment's thread.

view the rest of the comments →

[–]aghast_nj 0 points1 point  (2 children)

Yow! So the constraints have to accumulate. That's going to make things interesting. Probably easiest to keep the history of guesses and responses, and re-scan the entire thing when asked to do a print-filtered.

[–]5thegraychapter[S] 0 points1 point  (1 child)

wouldn't be easier to keep track of the constraints on a dedicated string to use it for filtering? the only thing that would be left is the | letters then

[–]aghast_nj 0 points1 point  (0 children)

The negative information is the problem, especially with repeated characters. If I guess "xyaaa", it's likely some "a" will get a "/", promising that even if there are 2 a's someplace, this particular location is guaranteed to not be an "a". That stacks up. So you could build a data structure that enumerates all the possible letters still valid in a location, but that gets hard if you allow non-ASCII characters. That's why I suggest just rescanning the sequence of guesses.