diff --git a/levenD.cpp b/levenD.cpp index 47c0d8f6a75fbcff74ff7009783bda7f5c640d1f..5dcf2cfa38caa186f4f38976aa9247191e010d1d 100644 --- a/levenD.cpp +++ b/levenD.cpp @@ -19,9 +19,8 @@ int levenD(const std::string &s, const std::string &t) { int m = t.length(); int cost = 0; - //Matrix to hold the levenshtein distance - int Matrix[n + 1][m + 1]; - + //Matrix to hold the levenshtein distance (longest string is 174) + int Matrix[175][175]; // Initialize the first row and column of the matrix,[0][0] is empty for (int i = 0; i <= n; i++) { Matrix[i][0] = i; diff --git a/main.cpp b/main.cpp index 9e77dd12db69494ea06c80d6a974053569601d93..606b0ce6110d69f52841c61a88a5ab72e8101cd3 100644 --- a/main.cpp +++ b/main.cpp @@ -7,6 +7,12 @@ int main() { std::list<Cards> scrambledCards; std::list<std::string> referenceCardNames; + /* on VsCode use this instead + //Take scrambled cards and put them in a list + scrambledCards = getListOfCards("../../scrambled.txt"); + //take reference names and put them in a list + referenceCardNames = referenceNames("../../reference.txt"); + */ //Take scrambled cards and put them in a list scrambledCards = getListOfCards("../scrambled.txt");