-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDesign.txt
86 lines (64 loc) · 1.65 KB
/
Design.txt
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Algorithm:
1) Find a word by selecting highest valued word.
Finding highest valued word:
Assign a score to each letter in each position
Green: 3 points
Yellow: 2 points
Gray: 0 points
2) Make guess (gather info)
3) Update known info
4) Crop word lists
Classes:
1) Board
2) WordList
3) Word
4) Guess
5) CharInfo
Board:
private:
WordList guesses
WordList answers
CharInfo
CharInfo:
public:
constructor
void update(Guess& g)
private:
map yellows
map greys
array map[5] greens
WordList:
public:
constructor(file name)
int updateWords(charInfo)
gets rid of words that are not a possible answer
Updates the value of words that are possible
returns the number of words it removed
string& getBestWord() const
private:
vector<Word> words
Word:
public:
constructor
bool checkWord(charInfo) const
returns true if a word is a possible answer given the
current known information
int getWordScore(charInfo)
string& getWord() const
private:
string word
Guess:
public:
Guess()
void inputInfo()
Gets user input for word and result
char array(?) getResult() const
string& getWord() const
string& getResult() const
private:
string word
string result
string& inputWord() const
Gets the users word
string& inputResult() const
Gets result from guessing the word