From 0cda99549250c87ab9c9b20044767a7615e279c6 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Sun, 3 Jul 2016 01:55:20 -0500 Subject: 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. --- quacker/quacker.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'quacker/quacker.cpp') 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(); -- cgit v1.2.3