-
Notifications
You must be signed in to change notification settings - Fork 24
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
Replace Bloom filter with compressed dictionary #8
base: main
Are you sure you want to change the base?
Conversation
ZetaTwo
commented
Feb 7, 2022
- Remove bloom filter
- Add compressed dictionary lookup
- Replace a bunch of magic values with constants
- Fix a bug where guesses was [5][6] when they should be [6][6] since they are used as null-terminated strings
Awesome work :) Where did you get the wordlist from? I wonder whether there are any copyright implications :/ |
The Wordle source code, presumably, which itself came from Collins Scrabble Words. |
I'm not a lawyer so take this with a massive grain of salt, but I think this would infringe on database rights in jurisdictions with them. The US doesn't have those, but I think it's ambiguous whether copyright applies. There's a notable Supreme Court decision that phonebooks are not eligible for copyright, but that's arguably different from a wordlist. |
Thanks! If it makes things easier, I can just remove the wordlist and let whoever builds the ROM supply their own list that they happen to "find" on the internet. :) |
Hmm there must be some open-source dictionaries we can use |
Yes but then it's not really Wordle anymore :D |
But yeah, the words are definitely from Collins: https://en.wikipedia.org/wiki/Collins_Scrabble_Words 12972 is way to specific to be an accident. |
e1e3109
to
797169c
Compare
Removed any copyrighted materials from the PR and integrated the C file generation into the Makefile. This should be completely safe to merge now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it and it works 💯
@@ -15,11 +15,14 @@ LCC = $(GBDK_HOME)bin/lcc | |||
PROJECTNAME = WORDLE | |||
|
|||
BINS = $(PROJECTNAME).gb | |||
CSOURCES := $(wildcard *.c) | |||
CSOURCES := main.c word-db.c words.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSOURCES := main.c word-db.c words.c | |
CSOURCES := $(wildcard *.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks if you compile from a fresh checkout since words.c does not exist and needs to be generated from the python script so it needs to be specified manually but you can't have *.c and words.c
because that will include it twice so in that case the CSOURCES needs to be "all files *.c except words.c" + "words.c" explicitly.
@@ -0,0 +1,16 @@ | |||
#include "word-db.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the same template is part of the Python generate script but I wanted to make it clear what the file will look like.
Ooops, that should not have been commited. Co-authored-by: Martin Pedersen <[email protected]>