Wordle-Bot icon indicating copy to clipboard operation
Wordle-Bot copied to clipboard

Explanation regarding the double call to calculate_entropies()

Open woctezuma opened this issue 1 year ago • 5 comments

I don't understand the double call to calculate_entropies(). Could you clarify the reason behind it?

https://github.com/GillesVandewiele/Wordle-Bot/blob/f6334959105549745300ff2c1fc7f80e7c8d7a07/wordle.py#L112-L117

Indeed:

  • the set all_words is a subset of all_dictionary,
  • the variable entropies is a dictionary whose keys are candidates by design.

So the second call to calculate_entropies() recomputes entropy values which were already computed by the first call.

If the objective is to decrease the number of items fed to max(), it could be done by filtering entropies returned by the first call.

https://github.com/GillesVandewiele/Wordle-Bot/blob/f6334959105549745300ff2c1fc7f80e7c8d7a07/wordle.py#L119-L120

woctezuma avatar Jul 23 '22 15:07 woctezuma