-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwordle_rules.h
55 lines (46 loc) · 1.6 KB
/
wordle_rules.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <string>
#include <vector>
#define VERSION 4.0
#define DEBUG true
#define DEBUG_UNICODE true
#define PRINT_GUESSES true
#define PRINT_GUESSES_SIZE 20
#define LIGHT_MODE false
#define DICTIONARY_FILENAME "answers.txt"
#define CREATE_SCORES_FILE false
#define DICTIONARY_SCORES_FILENAME "scores_new.txt"
static size_t g_num_runs = 0; // TODO: remove, not implemented in multi-threaded
static const size_t MAX_GUESSES = 6;
static const size_t LETTER_COUNT = 5;
enum class WordleResult {
GREEN,
YELLOW,
BLACK
};
struct WordleKnown {
char letter;
WordleResult result;
};
struct WordleGuess {
WordleGuess(std::string cGuess, std::vector<WordleResult> cResults)
: guessStr(cGuess), results(cResults) {}
WordleGuess(std::string cGuess)
: guessStr(cGuess) {
auto results = std::vector<WordleResult>{};
}
inline bool operator==(const WordleGuess& w1) const {
return w1.results == results;
}
inline bool operator!=(const WordleGuess& w1) const {
return w1.results != results;
}
std::string guessStr;
std::vector<WordleResult> results;
};
static auto CorrectWordleResult = std::vector<WordleResult>{WordleResult::GREEN,
WordleResult::GREEN,
WordleResult::GREEN,
WordleResult::GREEN,
WordleResult::GREEN};
static auto CorrectWordleGuess = WordleGuess("", CorrectWordleResult);