diff --git a/html-src/rules/fireandice.html b/html-src/rules/fireandice.html new file mode 100644 index 00000000..9aa3dcde --- /dev/null +++ b/html-src/rules/fireandice.html @@ -0,0 +1,24 @@ +
+One-deck game type. 1 deck. No redeal. + +
+Move all the red "fire" cards to the left five tableau piles and the black +"ice" cards to the right five tableau piles. + +
+Five cards are dealt to each of ten tableau piles, with the leftmost and +rightmost piles receiving an extra card. Any card or sequence of cards can +be moved between tableau piles, building down by rank, regardless of suit. +
+In this game, the red cards are called "fire" cards and the black cards are +called "ice" cards. The object is to move all of the "fire" cards to the +leftmost five tableau piles, and all the "ice" cards to the rightmost five. +When dealing, a gap is left between the two sets of tableau piles to show +this clearer. + +
+Fire and Ice was invented by David Bernazzani. diff --git a/html-src/rules/wavemotion.html b/html-src/rules/wavemotion.html index cf778844..9e0f4877 100644 --- a/html-src/rules/wavemotion.html +++ b/html-src/rules/wavemotion.html @@ -16,3 +16,8 @@ Cards may not be moved between the reserve stacks. The tableau stacks are built down by suit. Any sequence of cards in the tableau stacks may be moved to another appropriate tableau stack. The game is won when four stacks contain complete sequences from king to ace. + +
+Wave Motion was invented by David Bernazzani. Its name is a reference to +the anime series Space Battleship Yamato, also called Star Blazers. diff --git a/pysollib/gamedb.py b/pysollib/gamedb.py index e0b94dca..72ff0930 100644 --- a/pysollib/gamedb.py +++ b/pysollib/gamedb.py @@ -381,7 +381,7 @@ class GI: GAMES_BY_INVENTORS = ( ("Paul Alfille", (8,)), ("C.L. Baker", (45,)), - ("David Bernazzani", (314,)), + ("David Bernazzani", (314, 830,)), ("Gordon Bower", (763, 783,)), ("Art Cabral", (9,)), ("Richard A. Canfield", (105,)), @@ -479,7 +479,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, 830))) + ('fc-2.16', tuple(range(827, 831))) ) # deprecated - the correct way is to or a GI.GT_XXX flag diff --git a/pysollib/games/curdsandwhey.py b/pysollib/games/curdsandwhey.py index d2e1cd12..0f01897d 100644 --- a/pysollib/games/curdsandwhey.py +++ b/pysollib/games/curdsandwhey.py @@ -45,8 +45,8 @@ from pysollib.stack import \ WasteTalonStack, \ isRankSequence, \ isSameSuitSequence -from pysollib.util import ACE, ANY_RANK, ANY_SUIT, KING, UNLIMITED_ACCEPTS, \ - UNLIMITED_MOVES +from pysollib.util import ACE, ANY_RANK, ANY_SUIT, BLACK, KING, RED,\ + UNLIMITED_ACCEPTS, UNLIMITED_MOVES # ************************************************************************ # * Curds and Whey @@ -528,6 +528,53 @@ class FourPacks(EightPacks): return True +# ************************************************************************ +# * Fire and Ice +# ************************************************************************ + +class FireAndIce(Game): + RowStack_Class = RK_RowStack + + def createGame(self, playcards=18): + l, s = Layout(self), self.s + self.setSize(l.XM + (10.5 * l.XS), + l.YM + l.YS + playcards * l.YOFFSET) + + x, y = l.XM, l.YM + for i in range(5): + s.rows.append(self.RowStack_Class(x, y, self)) + x += l.XS + + x += l.XS / 2 + + for i in range(5): + s.rows.append(self.RowStack_Class(x, y, self)) + x += l.XS + + x, y = self.width - l.XS, self.height - l.YS + s.talon = InitialDealTalonStack(x, y, self) + + l.defaultStackGroups() + + def startGame(self): + for i in range(4): + self.s.talon.dealRow(frames=0) + r = self.s.rows + rows = (r[0], r[9]) + self.s.talon.dealRow(rows=rows, frames=0) + self._startAndDealRow() + + def isGameWon(self): + for i in self.s.rows[0:5]: + for j in i.cards: + if j.color != RED: + return False + for i in self.s.rows[5:10]: + for j in i.cards: + if j.color != BLACK: + return False + + # register the game registerGame(GameInfo(294, CurdsAndWhey, "Curds and Whey", GI.GT_SPIDER | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL)) @@ -564,3 +611,5 @@ registerGame(GameInfo(724, EightPacks, "Eight Packs", GI.SL_MOSTLY_SKILL)) registerGame(GameInfo(762, FourPacks, "Four Packs", GI.GT_2DECK_TYPE, 2, 1, GI.SL_MOSTLY_SKILL)) +registerGame(GameInfo(830, FireAndIce, "Fire and Ice", + GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL)) diff --git a/pysollib/games/grandfathersclock.py b/pysollib/games/grandfathersclock.py index 9a2eb06a..6f6dc330 100644 --- a/pysollib/games/grandfathersclock.py +++ b/pysollib/games/grandfathersclock.py @@ -40,7 +40,7 @@ from pysollib.stack import \ StackWrapper, \ WasteStack, \ WasteTalonStack -from pysollib.util import ACE, ANY_SUIT, JACK, KING, QUEEN, RANKS +from pysollib.util import ACE, ANY_SUIT, BLACK, JACK, KING, QUEEN, RANKS, RED class GrandfathersClock_Hint(CautiousDefaultHint): @@ -187,9 +187,6 @@ class Dial(Game): # * Hemispheres # ************************************************************************ -BLACK, RED = 0, 1 - - class Hemispheres_Hint(DefaultHint): def shallMovePile(self, from_stack, to_stack, pile, rpile): if not self._defaultShallMovePile(from_stack, to_stack, pile, rpile): diff --git a/pysollib/util.py b/pysollib/util.py index 447f6319..bc577655 100644 --- a/pysollib/util.py +++ b/pysollib/util.py @@ -52,6 +52,10 @@ SPADE = 1 HEART = 2 DIAMOND = 3 +# Specific colors +BLACK = 0 +RED = 1 + # Card ranks are 0-12. We also define symbolic names for the picture cards. RANKS = (_("Ace"), "2", "3", "4", "5", "6", "7", "8", "9", "10", _("Jack"), _("Queen"), _("King"))