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

fix multiple words per guess issue #26

Closed
wants to merge 2 commits into from

Conversation

briaguya-ai
Copy link

@briaguya-ai briaguya-ai commented May 7, 2022

resolves #23

in order to diagnose this, i expanded

return scores
.map<[string, number]>((score, i) => [words[i], score])
.filter((p) => p[1] !== 15)
.sort((a, b) => b[1] - a[1])
.map((k) => k[0])

out to be
export function sortByValue(words: string[], guesses: string[]) {
// iterate through each word and give it a score
let scores = words.map((word) => scoreWordle(word, guesses));
let mappedScores = scores.map<[string, number]>((score, i) => [words[i], score])
let filteredScores = mappedScores.filter((p) => p[1] !== 15)
let filteredBlargScores = mappedScores.filter((p) => p[1] === 15)
console.log(filteredBlargScores)
let sortedScores = filteredScores.sort((a, b) => b[1] - a[1])
let mappedAgainScores = sortedScores.map((k) => k[0])
return mappedAgainScores
// return scores
// .map<[string, number]>((score, i) => [words[i], score])
// .filter((p) => p[1] !== 15)
// .sort((a, b) => b[1] - a[1])
// .map((k) => k[0])
}

then i played a bit, at which point i noticed
image

instead of trying to understand the scoring system, i just made scoreWordle return 100 if the word is in guesses, and changed the !== 15 to be !== 100

@briaguya-ai
Copy link
Author

i just realized it's possible this is intended behavior, as the words that are marked as solved would be obvious by reading the greens

@briaguya-ai
Copy link
Author

closing this, seems like it's intended (#11)

@briaguya-ai briaguya-ai closed this May 7, 2022
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

Successfully merging this pull request may close these issues.

Overlapping Words
1 participant