erikhatcher / solrdle

Solr powered Wordle guesser
Apache License 2.0
2 stars 0 forks source link

Duplicate letter guesses with one green and one grey suggests invalid solutions #1

Open erikhatcher opened 1 year ago

erikhatcher commented 1 year ago
% ruby word_guesser.rb "STARE xxxxx" "DOILY x^x^^" "LOWLY x^x^^"
COYLY
FOLLY
GOLLY
HOLLY
JOLLY
NOBLY

All _OLLY words aren't possible answers since LOWLY's first L response indicates there are no (more) L's.

erikhatcher commented 1 year ago

This was fixed when I ported this over to Atlas Search in https://github.com/erikhatcher/mongordle/blob/main/word_guesser.rb

The fix was to exclude L in every position when x was processed, but when making the search engine constraints ignore the positional excludes on characters that are green/^

erikhatcher commented 1 year ago

Here's mongordle's response:

➜  mongordle git:(main) ✗ ruby word_guesser.rb "STARE xxxxx" "DOILY x^x^^" "LOWLY x^x^^"
{"letters":{"$nin":["S","T","A","R","E","D","I","W"],"$all":["O","L","Y"]},"letter1":{"$nin":["L"]},"letter2":{"$eq":"O"},"letter3": {"$nin":["L"]},"letter4":{"$eq":"L"},"letter5":{"$eq":"Y"}}
COYLY
NOBLY
2