[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/backgammon
From: Dmitry Vladimirovich Chernov <diman4ik.chernov () gmail ! com>
Date: 2013-07-10 16:53:38
Message-ID: E1Uwxe6-0003mp-UB () scm ! kde ! org
[Download RAW message or body]
SVN commit 1359830 by dmitryvchernov:
bugfix
M +8 -0 games/backgammon/backgammon_ruleset.cpp
M +11 -0 test/test_backgammon_ruleset.cpp
--- trunk/playground/games/backgammon/games/backgammon/backgammon_ruleset.cpp \
#1359829:1359830 @@ -91,6 +91,14 @@
int length = qAbs( src - dst );
+ if( dst >= BackgammonGame::bar_ind )
+ {
+ if( dir == IPlayer::positive )
+ length = qAbs( BackgammonGame::bar_ind - src );
+ else
+ length = qAbs( 0 - src );
+ }
+
QVector<int> ret;
if( dice.size() == 1 )
--- trunk/playground/games/backgammon/test/test_backgammon_ruleset.cpp \
#1359829:1359830 @@ -199,7 +199,18 @@
QVERIFY( used.size() == 3 );
}
+
+ {
+ const QVector<int> field = { 0, -3, -1, -2, -2, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 4, 0, 9, 0, 1, 0, 0, 0, 0, 1 }; +
+ const QVector<int> dice = { 3, 3, 3 };
+
+ QVector<int> used =
+ BackgammonRuleset::getUsedDice( field, IPlayer::negative, dice, 2, 26 );
+
+ QVERIFY( used.size() == 1 );
}
+}
void TestBackgammonRuleset::testCanThrow()
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic