summaryrefslogtreecommitdiff
path: root/quacker/macondobackend.cpp
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-08-24 13:27:27 -0400
committerpommicket <pommicket@gmail.com>2025-08-24 13:27:27 -0400
commitc1055b0b9c58bbe07d376707318028d1e6026162 (patch)
tree82fd3b8b0ffa236f173cda6f668584fab4d6f353 /quacker/macondobackend.cpp
parent82f08e0d21520a6c673a2a4ee5737f12752db6c5 (diff)
Fix dotDescription issues, update README
Diffstat (limited to 'quacker/macondobackend.cpp')
-rw-r--r--quacker/macondobackend.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/quacker/macondobackend.cpp b/quacker/macondobackend.cpp
index 628066a..db9eee3 100644
--- a/quacker/macondobackend.cpp
+++ b/quacker/macondobackend.cpp
@@ -191,9 +191,12 @@ Quackle::Move MacondoBackend::createPlaceMove(const std::string &placement, cons
dotDescription += tiles.substr(i);
break;
}
- dotDescription += tiles.substr(i, j) + ".";
+ dotDescription += tiles.substr(i, j - i);
i = tiles.find(')', j);
if (i == std::string::npos) throw "mismatched parentheses";
+ // add appropriate number of dots
+ for (size_t d = 1; d < i - j; d++)
+ dotDescription.push_back('.');
i++;
}
auto move = Quackle::Move::createPlaceMove(placement, QUACKLE_ALPHABET_PARAMETERS->encode(dotDescription));