Able to turn the expanded dict on and off with a variable

This commit is contained in:
David Volovskiy 2024-08-17 06:22:24 -04:00
parent 10eda8b208
commit 6dd46b46b1
2 changed files with 15 additions and 0 deletions

View file

@ -67,11 +67,14 @@ static const char _legal_words[][WORDLE_LENGTH + 1] = {
"SCOOP", "EASEL", "LOONS", "CONIC", "SPANS", "SPIES", "PRIOR", "SALSA", "SELLS",
"PILLS", "RISES", "RARES", "SNEER", "SOILS", "ARENA", "CASES", "CANAL", "SAILS",
"LASSO", "COCOA", "ERROR", "CALLS",
#if (USE_EXPANDED_DICT != 1)
};
// These are words that'll never be used, but still need to be in the dictionary for guesses.
// Top 100K most common words from Wiktionary https://gist.github.com/h3xx/1976236
// Number of words found: 469
static const char _expanded_words[][WORDLE_LENGTH + 1] = {
#endif
#if (USE_EXPANDED_DICT != 0)
"PARIS", "APRIL", "SPAIN", "EINEN", "ASCII", "EINER", "SEINE", "AINSI", "ALICE",
"ALLES", "ALORS", "EINES", "ALLER", "PEINE", "PARCE", "CELLE", "CLARA", "ELLES",
"ELLEN", "OLISI", "ALLEN", "ISAAC", "APRES", "CROIS", "SANOI", "PASSE", "ELSIE",
@ -125,8 +128,13 @@ static const char _expanded_words[][WORDLE_LENGTH + 1] = {
"NOONE", "SEPPI", "OPPIA", "SEALE", "LIPPI", "PELAS", "COCOS", "PLACA", "CONOR",
"LANCA", "OSASI", "ALOIS", "NAIRN", "PIENO", "SPASS", "SAONE", "ALNAR", "CARIA",
"PIENA",
#endif
};
#if (USE_EXPANDED_DICT == 1)
static const char _expanded_words[][WORDLE_LENGTH + 1] = {};
#endif
static const uint16_t _num_unique_words = 155; // The _legal_words array begins with this many words where each letter is different.
static const uint16_t _num_words = (sizeof(_legal_words) / sizeof(_legal_words[0]));
static const uint16_t _num_expanded_words = (sizeof(_expanded_words) / sizeof(_expanded_words[0]));

View file

@ -60,6 +60,13 @@
#define WORDLE_MAX_ATTEMPTS 6
#define USE_DAILY_STREAK false
/* USE_EXPANDED_DICT
* 0 = don't use it at all (saves 2.8KB of ROM)
* 1 = Include the expanded dict in answers
* 2 = Only include it in the dict for guessing, but it's never an answer
*/
#define USE_EXPANDED_DICT 2
typedef enum {
WORDLE_LETTER_WRONG = 0,
WORDLE_LETTER_WRONG_LOC,