Replace Bloom filter with compressed dictionary - #8
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. |
|
|
||
| BINS = $(PROJECTNAME).gb | ||
| CSOURCES := $(wildcard *.c) | ||
| CSOURCES := main.c word-db.c words.c |
There was a problem hiding this comment.
| CSOURCES := main.c word-db.c words.c | |
| CSOURCES := $(wildcard *.c) |
There was a problem hiding this comment.
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.
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 <martin@m4r7.in>