1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Added two-deck Fourteen game.

This commit is contained in:
Joe R 2022-11-20 10:49:58 -05:00
parent db3180abba
commit 73dca1b206
3 changed files with 40 additions and 10 deletions

View file

@ -0,0 +1,16 @@
<h1>Double Fourteen</h1>
<p>
Pairing game type. 2 decks. No redeal.
<h3>Object</h3>
<p>
Discard all pairs of cards that add up to fourteen in rank.
<h3>Quick Description</h3>
<p>
Like <a href="fourteen.html">Fourteen</a>,
but with two decks and eighteen playing piles.
<h3>Notes</h3>
<p>
<i>Autodrop</i> is disabled for this game.

View file

@ -400,10 +400,10 @@ class GI:
# Cascade, Club, Color Cell, Cornelius, Demons and Thieves, # Cascade, Club, Color Cell, Cornelius, Demons and Thieves,
# Desert Fox, Deuces and Queens, Double Antares, # Desert Fox, Deuces and Queens, Double Antares,
# Double Antarctica, Double Arctica, Double Baker's Spider, # Double Antarctica, Double Arctica, Double Baker's Spider,
# Double Cascade, Double Fourteens, Double Line 8, # Double Cascade, Double Line 8, Double Majesty,
# Double Majesty, Double Spidercells, Doublet Cell 5, Doubt, # Double Spidercells, Doublet Cell 5, Doubt, Dream Fan,
# Dream Fan, Dumfries Cell, Falcon Wing, Fan Nine, Fanny 6, # Dumfries Cell, Falcon Wing, Fan Nine, Fanny 6, Four By Ten,
# Four By Ten, FreeCell AK, Gaps Alter, Gaps Diff, George V, # FreeCell AK, Gaps Alter, Gaps Diff, George V,
# Grandmother's Clock, In a Frame, Inverted FreeCell, Kings, # Grandmother's Clock, In a Frame, Inverted FreeCell, Kings,
# Klondike FreeCell, La Cabane, La Double Entente, # Klondike FreeCell, La Cabane, La Double Entente,
# Little Gazette, Magic FreeCell, Mini Gaps, Montreal, # Little Gazette, Magic FreeCell, Mini Gaps, Montreal,
@ -425,7 +425,7 @@ class GI:
415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480, 484, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480, 484,
511, 512, 513, 516, 561, 610, 625, 629, 631, 638, 641, 647, 511, 512, 513, 516, 561, 610, 625, 629, 631, 638, 641, 647,
650, 655, 678, 734, 751, 784, 825, 829, 834, 837, 844, 862, 650, 655, 678, 734, 751, 784, 825, 829, 834, 837, 844, 862,
901, 867, 901,
)), )),
# xpat2 1.06 (we have 14 out of 16 games) # xpat2 1.06 (we have 14 out of 16 games)
@ -546,7 +546,7 @@ class GI:
tuple(range(22217, 22219))), tuple(range(22217, 22219))),
('fc-2.14', tuple(range(811, 827))), ('fc-2.14', tuple(range(811, 827))),
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))), ('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))),
('dev', tuple(range(855, 867))) ('dev', tuple(range(855, 868)))
) )
# deprecated - the correct way is to or a GI.GT_XXX flag # deprecated - the correct way is to or a GI.GT_XXX flag

View file

@ -436,6 +436,7 @@ class Neighbour(MonteCarlo):
# ************************************************************************ # ************************************************************************
# * Fourteen # * Fourteen
# * Double Fourteen
# ************************************************************************ # ************************************************************************
class Fourteen_RowStack(MonteCarlo_RowStack): class Fourteen_RowStack(MonteCarlo_RowStack):
@ -456,21 +457,21 @@ class Fourteen(Game):
# game layout # game layout
# #
def createGame(self): def createGame(self, colsperrow=6):
# create layout # create layout
l, s = Layout(self), self.s l, s = Layout(self), self.s
# set window # set window
self.setSize(l.XM + 7*l.XS, l.YM + 5*l.YS) self.setSize(l.XM + (colsperrow + 1) * l.XS, l.YM + 5 * l.YS)
# create stacks # create stacks
for i in (0, 2.5): for i in (0, 2.5):
for j in range(6): for j in range(colsperrow):
x, y = l.XM + j*l.XS, l.YM + i*l.YS x, y = l.XM + j*l.XS, l.YM + i*l.YS
s.rows.append(self.RowStack_Class(x, y, self, s.rows.append(self.RowStack_Class(x, y, self,
max_move=1, max_accept=1, max_move=1, max_accept=1,
dir=0, base_rank=NO_RANK)) dir=0, base_rank=NO_RANK))
x, y = l.XM + 6*l.XS, l.YM x, y = l.XM + colsperrow * l.XS, l.YM
s.foundations.append(self.Foundation_Class(x, y, self, suit=ANY_SUIT, s.foundations.append(self.Foundation_Class(x, y, self, suit=ANY_SUIT,
max_move=0, max_cards=52, base_rank=ANY_RANK)) max_move=0, max_cards=52, base_rank=ANY_RANK))
l.createText(s.foundations[0], "s") l.createText(s.foundations[0], "s")
@ -496,6 +497,16 @@ class Fourteen(Game):
return card1.rank + card2.rank == 12 return card1.rank + card2.rank == 12
class DoubleFourteen(Fourteen):
def createGame(self):
Fourteen.createGame(self, colsperrow=9)
def startGame(self):
self._startDealNumRows(4)
self.s.talon.dealRow()
self.s.talon.dealRow(rows=self.s.rows[:14])
# ************************************************************************ # ************************************************************************
# * Nestor # * Nestor
# * Double Nestor # * Double Nestor
@ -1021,3 +1032,6 @@ registerGame(GameInfo(862, SimpleTens, "Simple Tens",
GI.GT_PAIRING_TYPE | GI.GT_STRIPPED, 1, 0, GI.SL_LUCK, GI.GT_PAIRING_TYPE | GI.GT_STRIPPED, 1, 0, GI.SL_LUCK,
ranks=(0, 1, 2, 3, 4, 5, 6, 7, 8), ranks=(0, 1, 2, 3, 4, 5, 6, 7, 8),
altnames=("Add Up Tens",))) altnames=("Add Up Tens",)))
registerGame(GameInfo(867, DoubleFourteen, "Double Fourteen",
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 2, 0,
GI.SL_MOSTLY_LUCK))