From 31a00d19b0b08eb41dce5ee5dc43d0460dffa324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 29 Nov 2020 03:28:02 +0100 Subject: only allow actual words --- labb5/src/Boggle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'labb5/src/Boggle.cpp') diff --git a/labb5/src/Boggle.cpp b/labb5/src/Boggle.cpp index 96a77b6..5bec889 100755 --- a/labb5/src/Boggle.cpp +++ b/labb5/src/Boggle.cpp @@ -116,7 +116,7 @@ bool prefix_matches(const string& prefix, const string& word) { } bool Boggle::find_single_word_helper(const string& word, point cur_point, string cur_word, set visited) const { - if (cur_word == word) { + if (cur_word == word && dictionary.contains(cur_word)) { return true; } visited.insert(cur_point); -- cgit v1.2.1