# Why does knuth mastermind algorithm favour guesses in S?

From the set of guesses with the maximum score select one as the next guess, choosing a member of S whenever possible.

I understand that the hidden code is in S, so it makes sense to choose a guess in S over one that couldn't possibly win in the next turn. But, is this the ONLY reason that this step is necessary? or does it have a more important purpose?

Knuth also gives an example showing that in some cases no member of $$S$$ will be among the highest scoring guesses and thus the guess cannot win on the next turn, yet will be necessary to assure a win in five.
Other things being equal, a guess in $$S$$ is likely to be better than a guess outside $$S$$ with the same score measured against remaining possibilities; as you say, you could then win on the next turn. But Knuth's original article said on page 3 about $$1462$$ that the score is more important than being in $$S$$, if your aim is to assure a win in five guess overall, and Knuth's aim was to show his algorithm never did worse than that.