Skip to content

Commit

Permalink
10.30PM
Browse files Browse the repository at this point in the history
  • Loading branch information
danhnahh committed Apr 12, 2024
1 parent ff00df8 commit e744e3d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AdvProg_L4-SimpleAI/main_simpleai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,31 @@ void save_filter(int id, const vector<string>& words, const string& mask, char c
int main()
{
// B0
//string wordFilePath = "data/hangman_wordlist.txt";
string wordFilePath = "data/hangman_wordlist.txt";
string wordFilePath = "data/hangman_dictionary.txt";
vector<string> vocabulary = readWordListFromFile(wordFilePath);
/*

vector<string> vocabulary;
vocabulary.push_back("hello");
vocabulary.push_back("good");
vocabulary.push_back("bad");
vocabulary.push_back("world");
vocabulary.push_back("nice");
*/


// B1
int maxGuess = readMaxGuess();
int wordLen = readWordLen();

vector<string> candidateWords = filterWordsByLen(wordLen, vocabulary);
//save_filter(1, wordLen, candidateWords, "-", '-');
// save_filter(1, wordLen, candidateWords, "-", '-');
set<char> selectedChars;
int incorrectGuess = 0;
string finalMessage = "";
string mask(wordLen, MASK_CHAR);
cout << "So your secret word looks like: " << mask << endl;

//cout << "Max guess: " << incorrectGuess << " Word-len: " << wordLen << " Word num: " << candidateWords.size() << endl;
cout << "Max guess: " << incorrectGuess << " Word-len: " << wordLen << " Word num: " << candidateWords.size() << endl;

while (true) {
// B2
Expand Down Expand Up @@ -111,7 +111,7 @@ int main()
finalMessage = "Maybe, you should give me more times to guess :(";
break;
} else {
// continue;
continue;
}
}
}
Expand Down

0 comments on commit e744e3d

Please sign in to comment.