diff options
author | pommicket <pommicket@gmail.com> | 2025-08-24 13:27:27 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-08-24 13:27:27 -0400 |
commit | c1055b0b9c58bbe07d376707318028d1e6026162 (patch) | |
tree | 82fd3b8b0ffa236f173cda6f668584fab4d6f353 /quacker | |
parent | 82f08e0d21520a6c673a2a4ee5737f12752db6c5 (diff) |
Fix dotDescription issues, update README
Diffstat (limited to 'quacker')
-rw-r--r-- | quacker/macondo.cpp | 6 | ||||
-rw-r--r-- | quacker/macondobackend.cpp | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/quacker/macondo.cpp b/quacker/macondo.cpp index 8272dd4..aba5bca 100644 --- a/quacker/macondo.cpp +++ b/quacker/macondo.cpp @@ -1,3 +1,8 @@ +/* +TODO: +- handle early exit from (pre-)endgame solve +*/ + #include "macondo.h" #include "macondobackend.h" @@ -231,6 +236,7 @@ void Macondo::gameChanged(Quackle::Game *game) { m_backend = new MacondoBackend(game, *m_initOptions); connectBackendSignals(); m_game = game; + clearLog(); } void Macondo::connectBackendSignals() { 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)); |