Wordle-Bot
Wordle-Bot copied to clipboard
Explanation regarding the double call to calculate_entropies()
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 ofall_dictionary
, - the variable
entropies
is a dictionary whose keys arecandidates
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