// This is the .h file you will edit and turn in. // We have provided a minimal skeleton for you, // but you must finish it as described in the spec. // Also remove these comments here and add your own, as well as on the members. // TODO: remove this comment header and replace it with your own #ifndef _boggle_h #define _boggle_h #include #include #include #include "lexicon.h" #include "grid.h" #include using namespace std; using point = pair; class Boggle { public: const string DICTIONARY_FILE = "EnglishWords.dat"; const int MIN_WORD_LENGTH = 4; static const int BOARD_SIZE = 4; Boggle(); bool letters_from_string(const string& letters); void read_dictionary(); void clear(); void shuffle(); set find_all_words() const; bool find_single_word(const string& word) const; string board_to_string() const; string user_words_to_string(int words_per_line = 3) const; string computer_words_to_string(int words_per_line = 3) const; void do_computer_turn(); int get_computer_words_size() const; int get_computer_score() const; int get_user_words_size() const; int get_user_score() const; bool word_is_valid(const string& word) const; bool word_is_unplayed(const string& word) const; void add_user_word(const string& word); private: void find_all_words_helper(set& words, point cur_point, string cur_word, set visited) const; bool find_single_word_helper(const string& word, point cur_point, string cur_word, set visited) const; string words_to_string(const set& words, int words_per_line) const; Lexicon dictionary; Grid board; set user_words; set computer_words; int user_score = 0; int computer_score = 0; }; #endif