summaryrefslogtreecommitdiffstats
path: root/labb5/src/Boggle.h
diff options
context:
space:
mode:
Diffstat (limited to 'labb5/src/Boggle.h')
-rwxr-xr-xlabb5/src/Boggle.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/labb5/src/Boggle.h b/labb5/src/Boggle.h
index 8e923a9..26cc524 100755
--- a/labb5/src/Boggle.h
+++ b/labb5/src/Boggle.h
@@ -19,9 +19,6 @@ using point = pair<int, int>;
class Boggle {
public:
- const string DICTIONARY_FILE = "EnglishWords.dat";
- const int MIN_WORD_LENGTH = 4;
- static const int BOARD_SIZE = 4;
bool debug_mode = false;
Boggle();
@@ -46,8 +43,9 @@ public:
void shuffle();
/*
- * Return wether a word can be constructed on the current board or not.
+ * Return whether a word can be constructed on the current board or not.
*
+ * Does not check if the word is a valid word or not.
* Times itself if debug_mode is enabled.
*/
bool find_single_word(const string& word) const;
@@ -82,28 +80,31 @@ public:
string words_to_string(const set<string>& words, int words_per_line = 8) const;
/*
- * Run calculations for when it's the computers turn.
+ * Run calculations for when it's the computer's turn.
*
- * Finds which words the computer found and how many points they're worths.
+ * Finds which words the computer found and how many points they're worth.
*/
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;
/*
* Add a word the user has found and awards points.
*
- * Does not do any checks.
+ * Does not perform any checks.
*/
void add_user_word(const string& word);
private:
+ const string DICTIONARY_FILE = "EnglishWords.dat";
+ const int MIN_WORD_LENGTH = 4;
+ static const int BOARD_SIZE = 4;
+
void find_all_words_helper(set<string>& words, point cur_point, string cur_word, set<point> visited) const;
bool find_single_word_helper(const string& word, point cur_point, string cur_word, set<point> visited) const;