diff --git a/html-src/rules/doubleuintah.html b/html-src/rules/doubleuintah.html new file mode 100644 index 000000000..5588e2f08 --- /dev/null +++ b/html-src/rules/doubleuintah.html @@ -0,0 +1,13 @@ +
+Golf type. 2 decks. Unlimited redeals. + +
+Move all cards to the foundation stacks. + +
+Like Uintah, +but with two decks, and eight foundations - two for +each suit and four for each color. diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index b0220a68a..2f84c4142 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -481,7 +481,7 @@ def _callback(gi, gt=game_type): ("C.L. Baker", (45,)), ("Mark S. Ball", (909,)), ("David Bernazzani", (314, 830,)), - ("Gordon Bower", (763, 783, 852,)), + ("Gordon Bower", (763, 783, 852, 959,)), ("Art Cabral", (9,)), ("Richard A. Canfield", (105, 835,)), ("Lillian Davies and Christa Baran", (605,)), @@ -598,7 +598,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, 959)) + tuple(range(5415, 5419)) + + ('dev', tuple(range(906, 960)) + tuple(range(5415, 5419)) + tuple(range(5600, 5624)) + tuple(range(11017, 11020)) + tuple(range(13168, 13169)) + tuple(range(18000, 18005)) + tuple(range(19000, 19012)) + tuple(range(22303, 22311)) + diff --git a/pysollib/games/golf.py b/pysollib/games/golf.py index b104d86bf..41aa2b291 100644 --- a/pysollib/games/golf.py +++ b/pysollib/games/golf.py @@ -646,7 +646,7 @@ class Robert(Game): def createGame(self, max_rounds=3, num_deal=1, num_foundations=1): layout, s = Layout(self), self.s - self.setSize(layout.XM + 4 * layout.XS, + self.setSize(layout.XM + max(4, num_foundations) * layout.XS, layout.YM + layout.TEXT_HEIGHT + 2 * layout.YS) x, y = layout.XM, layout.YM if num_foundations == 1: @@ -662,7 +662,8 @@ def createGame(self, max_rounds=3, num_deal=1, num_foundations=1): layout.createText(stack, 's') x += layout.XS - x, y = layout.XM+layout.XS, layout.YM + layout.YS + layout.TEXT_HEIGHT + x, y = layout.XM + (layout.XS * max((num_foundations // 2) - 1, 1)), \ + layout.YM + layout.YS + layout.TEXT_HEIGHT s.talon = WasteTalonStack(x, y, self, max_rounds=max_rounds, num_deal=num_deal) layout.createText(s.talon, 'nw') @@ -700,9 +701,9 @@ def createGame(self): # ************************************************************************ # * Uintah +# * Double Uintah # ************************************************************************ - class Uintah_Foundation(AbstractFoundationStack): def acceptsCards(self, from_stack, cards): if not AbstractFoundationStack.acceptsCards(self, from_stack, cards): @@ -741,6 +742,28 @@ def _shuffleHook(self, cards): return cards + top_cards +class DoubleUintah(Uintah): + Foundation_Stack = Uintah_Foundation + + def createGame(self): + Robert.createGame(self, max_rounds=UNLIMITED_REDEALS, num_deal=3, + num_foundations=8) + + def _shuffleHook(self, cards): + top_cards = [] + for s in range(2): + suits = [] + for c in cards[:]: + if c.suit not in suits: + suits.append(c.suit) + top_cards.append(c) + cards.remove(c) + if len(suits) == 4: + break + top_cards.sort(key=lambda x: -x.suit) # sort by suit + return cards + top_cards + + # ************************************************************************ # * Diamond Mine # ************************************************************************ @@ -1536,3 +1559,6 @@ def fillStack(self, stack): registerGame(GameInfo(941, BinaryStar, "Binary Star", GI.GT_GOLF | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL, altnames=("Black Holes",))) +registerGame(GameInfo(959, DoubleUintah, "Double Uintah", + GI.GT_GOLF, 2, UNLIMITED_REDEALS, + GI.SL_MOSTLY_LUCK))