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 string contains check in submit function #51

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

westonclark
Copy link
Contributor

Summary

Fix Issue #50

When submitting an answer, the returned message is usually something like "That's not the right answer. If you're stuck, make sure you're using the full input data; there are also some general tips on the about page, or you can ask for hints on the subreddit."

The check if strings.Contains(message, "right answer") was evaluating to true since the string did in fact contain that substring.

Fixed the conditional to be more specific and check exactly for the string "That's the right answer!"

@DaltonSW DaltonSW merged commit e4d0f84 into DaltonSW:main Dec 3, 2024
1 check passed
@DaltonSW
Copy link
Owner

DaltonSW commented Dec 3, 2024

Could've sworn I tested the string checking better but... Can't say I'm surprised. Thanks so much, I really appreciate the contribution @westonclark!

I'll have this in the new release tomorrow morning, but you can run it from source if you're looking to do day 3 at launch

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