3b1b/videos

Problem with handling duplicates with the current New York Times implementation

cobase2010 opened this issue · 2 comments

With Wordle moved to https://www.nytimes.com/games/wordle/index.html, it seems to have changed how duplicates are handled.

For example for puzzle 237, after
crane (yybby)
recur (bygyg). (Before the migration, the color pattern was "yygyg" so it now count the second "R" as not existing instead of misplaced for the answer word "ulcer".

I tried both fixes for handling duplicates but neither seems to have fixed it.

The current wordle.py generates the following error:

Traceback (most recent call last):
File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1141, in objc_method
result = f(py_self, *args)
File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/window/cocoa/pyglet_view.py", line 199, in pygletKeyDown_
self._window.dispatch_event('on_key_press', symbol, modifiers)
File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/window/init.py", line 1352, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/event.py", line 408, in dispatch_event
if handler(*args):
File "/Users/markyoung/Projects/manim/manimlib/window.py", line 106, in on_key_press
self.scene.on_key_press(symbol, modifiers)
File "_2022/wordle.py", line 1449, in on_key_press
super().on_key_press(symbol, modifiers)
File "_2022/wordle.py", line 1190, in on_key_press
super().on_key_press(symbol, modifiers)
File "_2022/wordle.py", line 772, in on_key_press
self.reveal_pattern()
File "_2022/wordle.py", line 1439, in reveal_pattern
super().reveal_pattern(*args, **kwargs)
File "_2022/wordle.py", line 887, in reveal_pattern
did_fill = super().reveal_pattern(pattern, animate)
File "_2022/wordle.py", line 604, in reveal_pattern
self.show_pattern(pattern, animate=animate)
File "_2022/wordle.py", line 915, in show_pattern
self.show_pattern_information(guess, pattern, new_possibilities)
File "_2022/wordle.py", line 925, in show_pattern_information
info = -math.log2(prob)
ValueError: math domain error

3b1b commented

Are you sure the convention actually changed? As I'm checking now, it seems to behave as expected.

Possibly you are running the code prior to the bug fix referenced in the most recent video?

Yes, after synching to the latest branch, it works now. I've made similar hacks before this and managed to get it to work but your solution was more elegant:)