Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of remaining possibilites is incorrect #2

Open
mroek opened this issue Oct 3, 2022 · 8 comments
Open

Calculation of remaining possibilites is incorrect #2

mroek opened this issue Oct 3, 2022 · 8 comments

Comments

@mroek
Copy link

mroek commented Oct 3, 2022

If the criteria for "remaining possible words" is that the possible words satisfy the already known information, then the current calculation is wrong.

The calculation has multiple deficiencies. It does not require that yellow letters be included, but it will (correctly) exclude them from being included at positions where they have already been tried. It also does not exclude gray letters where the same letter has been found in the correct place (hence being green). In that case, the player knows that there will be only one occurrence of that particular letter, but the calculation of remaining possibilities does not take that into account.

The net result is that the shown number of remaining possibilities usually is way higher than what is real (given that the player actually uses the known information correctly). Whether it is like this on purpose I don't know, but I'd have liked to see the real number of possibilities instead of the (most often) inflated number that it shows in the current version.

Here's an example game:
https://evancharlton.github.io/ordle/#/nb-no/2963

Let's say the player enters the word RISTE at the first line for this game. The game will now claim that there are 261 possible words left, by excluding the letters R and T everywhere, excluding I at position 2 and excluding E at position 5, and also requiring S at position 3. However, it does not require that I and E be present in the word, which I think it should have. If it had done that, it would have found the real number of possible words, which is just 4. That's a big difference to the 261 that the game claims.

The player now enters the word ISSEN at line number two. The game will now claim that there are still 120 possible correct words, by excluding the letters R, T and N everywhere, excluding I at position 1 and 2, excluding S at position 2, excluding E at position 4 and 5, and requiring S at position 3. The letter S should now be excluded everywhere except in position 3 (but the game only excludes it in position 2), and it should also require I and E to be present. Had it done that, it would have arrived at the correct number of possibilites, which is just 2 (not 120). The two remaining possible words are now DESIM and EKSIL, and if the player enters DESIM, the game will still claim 7 remaining possibilities, but in reality there is just one.

@evancharlton
Copy link
Owner

You're exactly right! This has been on my mind to fix for a while, but I haven't gotten around to it (obviously).

I'll rework this logic soon and make the logic better. Thanks for the detailed report with the reproduction steps included - it's very helpful! I've only noticed it while playing but never wrote anything down.

@mroek
Copy link
Author

mroek commented Oct 3, 2022

Great, that's much better than me having to manually build the regexes when I really want to know how many possibilites are left in a game. Looking forward to the improved logic. Shouldn't be too hard to implement, I think.

@evancharlton
Copy link
Owner

I just pushed an update that should fix this -- please give it a shot and let me know if you find any bugs! Sorry it took so long; it took me longer than I'd like to admit to figure out a decent strategy for it!

image

@mroek
Copy link
Author

mroek commented Jan 31, 2023

I'll check it out. I also created my own offline application to do this for me (too impatient), and I can check your implementation against that (because I know it is pretty reliable).

@mroek
Copy link
Author

mroek commented Feb 1, 2023

Edit: My browser must have cached something, because when I tested again, it provided the correct numbers.

@evancharlton
Copy link
Owner

Yeah, I think that you got hit by a service worker cache or something. I should make that a better experience.

Thanks for the thorough testing!!

@mroek
Copy link
Author

mroek commented Feb 16, 2023

Seems there is a case you have missed:

https://evancharlton.github.io/ordle/#/nb-no/10150

Input RISTE at first line, and there will be 289 remaining possibilites, which is correct.
Then input TREGT, and it claims that there are 29 remaining. However, the correct number is 10.

I'm guessing the problem is that you don't eliminate all words with two T's in them. The correct answer does contain one T, but
in a different position to any of the two in TREGT.

@evancharlton
Copy link
Owner

Hei!

Sorry, I was offline for a bit. Thanks for the fresh (& detailed!) report - I'll take a look at fixing this one, too :)

@evancharlton evancharlton reopened this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants