3b1b / videos

Code for the manim-generated scenes used in 3blue1brown videos
6.01k stars 1.57k forks source link

Handling duplicates in guesses and actual word #21

Closed sid-1698 closed 2 years ago

sid-1698 commented 2 years ago

When there's a duplicate in our guess but there's no or less duplicates in the original word, it should be handled effectively.

Scenario 1: When the first instance is at the correct position Word: ABCDE Guess: ABACB

Current implementation shows: image

Whereas, it should ideally be image

Scenario 2: When the first instance is at the wrong position Word: ABCDE Guess: BADAE

Current implementation shows: image

Whereas, it should ideally be image

Special Cases: When the duplicate count is less in the actual word than guess Word: ABBCD Guess: ABCBB

Current implementation shows: image

Whereas, it should ideally be image

McAJBen commented 2 years ago

Have you tested this against the following example? Word: AABBA Guess: BABBA Correct Answer: ⬛🟩🟩🟩🟩

cobase2010 commented 2 years ago

I noticed that the old wordle website follows the behavior coded in the original algorithm. However, after they've moved to the New York Times website, it now handles duplicates differently, ie. it no longer colors a duplicate letter if it's already been consumed by another position.

Anyone else noticed that too?

cobase2010 commented 2 years ago

The issue didn't seem to get fixed by this, see details in issue#35.

3b1b commented 2 years ago

I ended up fixing this in a different way, but thank you!