diff --git a/wordle-wasm.htm b/wordle-wasm.htm index ef759c3..23cb410 100644 --- a/wordle-wasm.htm +++ b/wordle-wasm.htm @@ -292,6 +292,6 @@ var chosen_words = [];

2. Use "Find best" to choose a word for you or enter in your own choice of word, and press Submit word. Submit this word in Wordle as well

3. Click on the letters of the word to match the results of what was matching according to Wordle. Hit confirm when it matches the colors of the word in Wordle. This will cause the solver to eliminate words that are no longer possible. If there was an error in the color pattern you can hit Back to remove the last confirmed word, and reenter it.

4. Optimally win Wordle.

-

There's a slight discrepancy between this and the original JavaScript version; the original Javascript version includes one extra word, which is probably just an empty line or something like that +

There's a slight discrepancy between this and the original JavaScript version; the original Javascript version includes one extra word, which is probably just an empty line or something like that. This leads to an extra word count in a lot of situations diff --git a/wordle_opt.wasm b/wordle_opt.wasm index fb82d8e..cadd9d1 100755 Binary files a/wordle_opt.wasm and b/wordle_opt.wasm differ diff --git a/wordle_opt/src/lib.rs b/wordle_opt/src/lib.rs index 09d37f0..310b875 100644 --- a/wordle_opt/src/lib.rs +++ b/wordle_opt/src/lib.rs @@ -165,6 +165,13 @@ impl Solver { } let mut cur_best = -1; let mut cur_entropy = 0f32; + for i in 0..self.valid_words.len() { + let entropy = self.calc_entropy(self.valid_words[i] as usize) + 1e-9; + if entropy > cur_entropy { + cur_entropy = entropy; + cur_best = self.valid_words[i] as isize; + } + } for i in 0..self.idxs.len() { let entropy = self.calc_entropy(i); if entropy > cur_entropy {