Skip to content
Permalink
Browse files

Complete native solver implementation

  • Loading branch information...
bobbymcr committed May 27, 2019
1 parent b779b27 commit 09c73567a44c3264324933f625e2862d90991fe7
Showing with 17 additions and 2 deletions.
  1. +17 −2 src/LetterBoxedSolver.Native/LetterBoxedSolver.cpp
@@ -1,5 +1,5 @@
#include "StrTrie.h"
#include "LetterBoxStr.h"
#include "LetterBoxStrSearch.h"
#include "LetterBoxStrWords.h"
#include "Stopwatch.h"
#include <iomanip>
#include <fstream>
@@ -40,5 +40,20 @@ int main(int argc, const char** argv)
ss << "Loaded " << trie.size() << " words.";
Log(ss.str().c_str());

LetterBoxStrSearch search(trie, box);
LetterBoxStrWords words;

Log("Finding valid words...");
search.run([&words](Str w, Vertices v) { words.insert(w, v); });
ss = stringstream();
ss << "Found " << words.size() << " valid words.";
Log(ss.str().c_str());
ss.clear();

Log("Finding solutions...");
words.find([](Str w1, Str w2) { cout << w1 << "-" << w2 << "\r\n"; });

Log("Done.");

return 0;
}

0 comments on commit 09c7356

Please sign in to comment.
You can’t perform that action at this time.