summaryrefslogtreecommitdiff
path: root/quacker/quacker.cpp
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2016-07-03 01:55:20 -0500
committerJohn Fultz <jfultz@wolfram.com>2016-07-03 01:55:20 -0500
commit0cda99549250c87ab9c9b20044767a7615e279c6 (patch)
treea53d4b1002ff6ae29f63e16aab25dab3082ba9ea /quacker/quacker.cpp
parent63e3348ace58bb8cc990d418269df61f640fc234 (diff)
Add a scoring option preference.
A checkbox in the preferences dialog now allows you to configure Quackle so that plays with illegal words which are left unchallenged score zero. Obviously, off by default. But useful for entering games as part of the Marty Gabriel/Scott Garner world record scoring attempt. This is apparently what the Guinness folks are looking for.
Diffstat (limited to 'quacker/quacker.cpp')
-rw-r--r--quacker/quacker.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp
index 69bf9f9..be70c14 100644
--- a/quacker/quacker.cpp
+++ b/quacker/quacker.cpp
@@ -297,6 +297,7 @@ void TopLevel::setCandidateMove(const Quackle::Move &move)
if (!m_game->hasPositions() || (move.action == Quackle::Move::Place && move.tiles().empty()))
return;
+ bool playHasIllegalWords = false;
Quackle::Move prettiedMove(move);
m_game->currentPosition().ensureMoveTilesDoNotIncludePlayThru(prettiedMove);
m_game->currentPosition().ensureMovePrettiness(prettiedMove);
@@ -367,6 +368,8 @@ void TopLevel::setCandidateMove(const Quackle::Move &move)
{
prettiedMove.setIsChallengedPhoney(true);
}
+ else
+ playHasIllegalWords = true;
}
validityFlags ^= Quackle::GamePosition::UnacceptableWord;
@@ -384,7 +387,10 @@ void TopLevel::setCandidateMove(const Quackle::Move &move)
if (!carryOn)
return;
- m_game->currentPosition().scoreMove(prettiedMove);
+ if (playHasIllegalWords && QuackleIO::UtilSettings::self()->scoreInvalidAsZero)
+ prettiedMove.score = 0;
+ else
+ m_game->currentPosition().scoreMove(prettiedMove);
m_game->currentPosition().addAndSetMoveMade(prettiedMove);
switchToTab(ChoicesTabIndex);
ensureUpToDateSimulatorMoveList();