On Optimal Strategies for Wordle and General Guessing Games