diff --git a/html-src/rules/yukonkings.html b/html-src/rules/yukonkings.html new file mode 100644 index 000000000..5a17c1ca8 --- /dev/null +++ b/html-src/rules/yukonkings.html @@ -0,0 +1,16 @@ +
+Yukon type. 1 deck. No redeal. + +
+Arrange all cards into four columns with complete sequences from +king to ace, built down by alternate color. + +
+Just like Yukon, +but with no foundations. To win the game, the +cards must be organized into four piles, built +down from king to ace by alternate color. +Difficult. diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index 432011960..da1094820 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -592,7 +592,7 @@ def _callback(gi, gt=game_type): ('fc-2.20', tuple(range(855, 897))), ('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) + tuple(range(13160, 13163)) + (16682,)), - ('dev', tuple(range(906, 936)) + tuple(range(11017, 11020)) + + ('dev', tuple(range(906, 937)) + tuple(range(11017, 11020)) + tuple(range(5600, 5624)) + tuple(range(18000, 18005)) + tuple(range(22303, 22311)) + tuple(range(22353, 22361))), ) diff --git a/pysollib/games/yukon.py b/pysollib/games/yukon.py index fc32522dd..9327bf638 100644 --- a/pysollib/games/yukon.py +++ b/pysollib/games/yukon.py @@ -41,7 +41,8 @@ WasteTalonStack, \ Yukon_AC_RowStack, \ Yukon_BO_RowStack, \ - Yukon_SS_RowStack + Yukon_SS_RowStack, \ + isAlternateColorSequence from pysollib.util import ANY_SUIT, KING @@ -706,6 +707,39 @@ def startGame(self): shallHighlightMatch = Game._shallHighlightMatch_AC +# ************************************************************************ +# * Yukon Kings +# ************************************************************************ + +class YukonKings(Yukon): + + def createGame(self, playcards=25): + l, s = Layout(self), self.s + self.setSize(l.XM + (7 * l.XS), + l.YM + l.YS + playcards * l.YOFFSET) + + x, y = l.XM, l.YM + for i in range(7): + s.rows.append(self.RowStack_Class(x, y, self)) + x += l.XS + + x, y = l.XM, self.height - l.YS + s.talon = InitialDealTalonStack(x, y, self) + + l.defaultStackGroups() + + def isGameWon(self): + cardsPlayed = False + for s in self.s.rows: + if s.cards: + if len(s.cards) != 13 or not isAlternateColorSequence(s.cards): + return False + cardsPlayed = True + if not cardsPlayed: + return False + return True + + # ************************************************************************ # * Yukon Cells # * Yukonic Plague @@ -860,3 +894,5 @@ def startGame(self): GI.GT_SPIDER, 1, 0, GI.SL_BALANCED)) registerGame(GameInfo(925, YukonCells, "Yukon Cells", GI.GT_YUKON, 1, 0, GI.SL_BALANCED)) +registerGame(GameInfo(936, YukonKings, "Yukon Kings", + GI.GT_YUKON, 1, 0, GI.SL_BALANCED))