#include #include using namespace std; #include "prompt.h" #include "utils.h" #include "dictionary.h" void Test (const Dictionary& dict) { cout << "Some secret words" << endl; for (int k = 0; k < 10; k++) { cout << k << "\t" << dict.GetSecretWord() << endl; } for (int k = 0; k < 3; k++) { string word = PromptString("enter a word: "); if (dict.Contains(word)) { cout << word << " is in dictionary" << endl; } else { cout << word << " NOT in dictionary" << endl; } } } int CommonCount (const string& a, const string& b) // post: returns # characters in common to strings a and b { int count = 0; // TODO: fill in code to determine letters in common return count; } void Play (const Dictionary& dict, int maxGuessesAllowed) { // TODO: get secret word and allow user to guess it maxGuessesAllowed times // for each guess, give user feedback based on // - if word is in dict // - if word is secret word // - number of letters in common } int main (int argc, char * argv[]) { string wordsfile = "words5_common.txt"; int maxGuesses = 15; Dictionary dict; dict.LoadWords(wordsfile); Test(dict); //Play(dict, maxGuesses); //WaitForReturn(); return 0; }