diff --git a/html-src/rules/kilowatt.html b/html-src/rules/kilowatt.html new file mode 100644 index 00000000..5710f36d --- /dev/null +++ b/html-src/rules/kilowatt.html @@ -0,0 +1,26 @@ +

Inverse Spark

+

+Forty Thieves type. 2 decks. No redeal. + +

Object

+

+Move all cards to the foundations. + +

Rules

+

+Twelve cards are dealt into twelve tableau piles. These +piles are built down by suit. Only one card can be moved +at a time. Any card can be used to fill empty piles in the +tableau. The kings are dealt to eight foundation piles, +which are built up by same suit, wrapping from king to ace +as necessary. +

+Cards from the talon are dealt to two waste piles, three +cards at a time to each. The top card from either waste pile +can be moved to a tableau or foundation pile. The game is won +if all the cards are moved to the foundation piles. + +

Notes

+

+Inverse Spark is an inverted variant of +The Spark. diff --git a/html-src/rules/thespark.html b/html-src/rules/thespark.html index 2a981c2e..472619f8 100644 --- a/html-src/rules/thespark.html +++ b/html-src/rules/thespark.html @@ -9,11 +9,10 @@ Move all cards to the foundations.

Rules

Twelve cards are dealt into twelve tableau piles. These -piles are built down by suit. Only one card can be moved +piles are built up by suit. Only one card can be moved at a time. Any card can be used to fill empty piles in the -tableau. The kings are dealt to eight foundation piles, -which are built up by same suit, wrapping from king to ace -as necessary. +tableau. Eight foundation piles are built down by same suit, +starting from the kings.

Cards from the talon are dealt to two waste piles, three cards at a time to each. The top card from either waste pile diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index 3c61576c..3bfe2a8e 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -361,7 +361,7 @@ class GI: # Napoleon's Guards, Nationale, Oasis, Opera, Ordered Suits, # Osmotic FreeCell, Pair FreeCell, Pairs 2, Petal, # Reserved Thirteens, Sea Spider, Sept Piles 0, Short Solitaire, - # Simple Alternations, Simple Spark, Step By Step, Strategy 7, + # Simple Alternations, Step By Step, Strategy 7, # Stripped FreeCell, Tarantula, Triple Dispute, Trusty Twenty, # Two Ways 3, Up Or Down, Versailles, Vertical FreeCell, # Wasp Baby, Yukon FreeCell @@ -374,7 +374,7 @@ class GI: 363, 364, 372, 376, 383, 384, 385, 386, 390, 391, 393, 398, 405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480, 484, 511, 512, 516, 561, 610, 625, 629, 631, 638, 641, 647, - 650, 655, 678, 734, 751, 784, 825, 829, 834, 901, + 650, 655, 678, 734, 751, 784, 825, 829, 834, 837, 901, )), # xpat2 1.06 (we have 14 out of 16 games) @@ -485,7 +485,7 @@ class GI: ('fc-2.12', tuple(range(774, 811)) + (16681,) + tuple(range(22217, 22219))), ('fc-2.14', tuple(range(811, 827))), - ('fc-2.16', tuple(range(827, 838))) + ('fc-2.16', tuple(range(827, 839))) ) # deprecated - the correct way is to or a GI.GT_XXX flag diff --git a/pysollib/games/fortythieves.py b/pysollib/games/fortythieves.py index ce9c82ed..66cb36c0 100644 --- a/pysollib/games/fortythieves.py +++ b/pysollib/games/fortythieves.py @@ -904,6 +904,7 @@ class Crossroads(Junction): # ************************************************************************ +# * Inverse Spark # * The Spark # * Single Spark # ************************************************************************ @@ -930,10 +931,14 @@ class TheSpark_Talon(TalonStack): return num_cards -class TheSpark(Game): +# Version of The Spark with incorrect rules from 2.14 and earlier. +# Renamed Kilowatt to differentiate from the correct version. +class Kilowatt(Game): Hint_Class = CautiousDefaultHint PER_ROW = 6 + FOUNDATION_DIR = 1 + ROW_DIR = -1 def createGame(self): @@ -945,7 +950,8 @@ class TheSpark(Game): x, y = l.XM, l.YM for i in range(self.gameinfo.decks * 4): s.foundations.append(SS_FoundationStack(x, y, self, - suit=i//2, base_rank=KING, mod=13)) + suit=i//self.gameinfo.decks, base_rank=KING, + mod=13, dir=self.FOUNDATION_DIR)) x += l.XS x, y = l.XM, l.YM+l.YS s.talon = TheSpark_Talon(x, y, self, max_rounds=1, num_deal=3) @@ -960,7 +966,8 @@ class TheSpark(Game): for i in range(2): x = l.XM+2*l.XS for j in range(self.PER_ROW): - stack = SS_RowStack(x, y, self, max_move=1) + stack = SS_RowStack(x, y, self, max_move=1, + dir=self.ROW_DIR) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS @@ -969,7 +976,7 @@ class TheSpark(Game): l.defaultStackGroups() def _shuffleHook(self, cards): - # move Aces to top of the Talon (i.e. first cards to be dealt) + # move Kings to top of the Talon (i.e. first cards to be dealt) return self._shuffleHookMoveToTop(cards, lambda c: (c.rank == KING, c.suit)) @@ -980,6 +987,17 @@ class TheSpark(Game): shallHighlightMatch = Game._shallHighlightMatch_SS +class TheSpark(Kilowatt): + FOUNDATION_DIR = -1 + ROW_DIR = 1 + + def _shuffleHook(self, cards): + return Game._shuffleHook(self, cards) + + def startGame(self): + self._startAndDealRowAndCards() + + class SingleSpark(TheSpark): PER_ROW = 4 @@ -1387,7 +1405,7 @@ registerGame(GameInfo(540, Waterloo, "Waterloo", registerGame(GameInfo(556, Junction, "Junction", GI.GT_FORTY_THIEVES, 4, 0, GI.SL_MOSTLY_SKILL, ranks=(0, 6, 7, 8, 9, 10, 11, 12))) -registerGame(GameInfo(564, TheSpark, "The Spark", +registerGame(GameInfo(564, Kilowatt, "Kilowatt", GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_LUCK)) registerGame(GameInfo(573, DoubleGoldMine, "Double Gold Mine", GI.GT_NUMERICA | GI.GT_ORIGINAL, 2, 0, @@ -1428,4 +1446,7 @@ registerGame(GameInfo(815, Following, "Following", registerGame(GameInfo(818, TripleRail, "Triple Rail", GI.GT_FORTY_THIEVES, 3, 0, GI.SL_BALANCED)) registerGame(GameInfo(837, SingleSpark, "Single Spark", - GI.GT_FORTY_THIEVES, 1, 0, GI.SL_MOSTLY_LUCK)) + GI.GT_FORTY_THIEVES, 1, 0, GI.SL_MOSTLY_LUCK, + altnames=("Simple Spark"))) +registerGame(GameInfo(838, TheSpark, "The Spark", + GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_LUCK))