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 wordle logic #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix wordle logic #4

wants to merge 1 commit into from

Conversation

danshea00
Copy link

The current logic in wordle_server.c is incorrect. If a misplaced letter keeps appearing more than the number of times it has appeared in the target word, it should not keep showing as yellow.

Example 1:

word:     hello
guess:    eeeee
output:   YGYYY
correct:  XGXXX

Example 2:

word:     hello
guess:    lelel
output:   YGGYY
correct:  YGGXX

Where Y is yellow, G is green, and X is grey.

Concerns are:

  • It might be confusing to have to call the calculate_states function then pack MRs using the states global
  • Not sure if static alphabet sized array and lines like counts[word[i] - 'a']++ is clear enough

@Ivan-Velickovic
Copy link
Collaborator

This is the first non-trivial change to the code since the release of the tutorial, which means it's a good test for the CI that I will setup soon. So I'll leave this PR open until that's done.

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.

2 participants