mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added Cascade game.
This commit is contained in:
parent
78ca717778
commit
634937b076
3 changed files with 60 additions and 12 deletions
21
html-src/rules/cascade.html
Normal file
21
html-src/rules/cascade.html
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<h1>Cascade</h1>
|
||||||
|
<p>
|
||||||
|
Forty Thieves type. 1 deck. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
Cards are dealt to seven piles of five cards each. The tableau piles
|
||||||
|
are built down by alternate color, and only single cards can be moved
|
||||||
|
between piles. There are also two free cells that any single card can
|
||||||
|
be moved to/from freely.
|
||||||
|
<p>
|
||||||
|
When there are no moves left, you can deal cards one at a time from the
|
||||||
|
talon, and move them to an appropriate tableau/free cell/foundation pile.
|
||||||
|
No redeal is allowed, so you can only go through the talon once.
|
||||||
|
<p>
|
||||||
|
The foundations are built up by alternate color from ace to king. The
|
||||||
|
game is won if all cards are moved to the foundations.
|
|
@ -435,8 +435,8 @@ class GI:
|
||||||
# still missing:
|
# still missing:
|
||||||
# Ace of Hearts, Agnes Three, Antares, Avenue, Baker's Fan,
|
# Ace of Hearts, Agnes Three, Antares, Avenue, Baker's Fan,
|
||||||
# Baker's Spider, Bedeviled, Binding, Black Holes,
|
# Baker's Spider, Bedeviled, Binding, Black Holes,
|
||||||
# Black Spider, California, Cascade, Club, Color Cell,
|
# Black Spider, California, Club, Color Cell, Cornelius,
|
||||||
# Cornelius, Desert Fox, Double Antares, Double Antarctica,
|
# Desert Fox, Double Antares, Double Antarctica,
|
||||||
# Double Arctica, Double Baker's Spider, Double Cascade,
|
# Double Arctica, Double Baker's Spider, Double Cascade,
|
||||||
# Double Majesty, Double Spidercells, Doublet Cell 5, Doubt,
|
# Double Majesty, Double Spidercells, Doublet Cell 5, Doubt,
|
||||||
# Dream Fan, Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten,
|
# Dream Fan, Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten,
|
||||||
|
@ -461,7 +461,7 @@ class GI:
|
||||||
398, 405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476,
|
398, 405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476,
|
||||||
480, 484, 511, 512, 513, 516, 561, 610, 613, 625, 629, 631,
|
480, 484, 511, 512, 513, 516, 561, 610, 613, 625, 629, 631,
|
||||||
638, 641, 647, 650, 655, 678, 684, 702, 734, 751, 784, 825,
|
638, 641, 647, 650, 655, 678, 684, 702, 734, 751, 784, 825,
|
||||||
829, 834, 837, 844, 862, 867, 880, 889, 901, 911,
|
829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933
|
||||||
)),
|
)),
|
||||||
|
|
||||||
# xpat2 1.06 (we have 14 out of 16 games)
|
# xpat2 1.06 (we have 14 out of 16 games)
|
||||||
|
@ -592,7 +592,7 @@ class GI:
|
||||||
('fc-2.20', tuple(range(855, 897))),
|
('fc-2.20', tuple(range(855, 897))),
|
||||||
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
|
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
|
||||||
tuple(range(13160, 13163)) + (16682,)),
|
tuple(range(13160, 13163)) + (16682,)),
|
||||||
('dev', tuple(range(906, 933)) + tuple(range(11017, 11020)) +
|
('dev', tuple(range(906, 934)) + tuple(range(11017, 11020)) +
|
||||||
tuple(range(5600, 5624)) + tuple(range(18000, 18004)) +
|
tuple(range(5600, 5624)) + tuple(range(18000, 18004)) +
|
||||||
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
|
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
|
||||||
)
|
)
|
||||||
|
|
|
@ -833,11 +833,18 @@ class Octagon(Game):
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
class Squadron(FortyThieves):
|
class Squadron(FortyThieves):
|
||||||
|
RowStack_Class = SS_RowStack
|
||||||
|
Foundation_Class = SS_FoundationStack
|
||||||
|
|
||||||
|
ROWS = 10
|
||||||
|
RESERVES = 3
|
||||||
|
|
||||||
def createGame(self):
|
def createGame(self):
|
||||||
l, s = Layout(self), self.s
|
l, s = Layout(self), self.s
|
||||||
|
decks = self.gameinfo.decks
|
||||||
|
|
||||||
self.setSize(l.XM+12*l.XS, l.YM+max(4.5*l.YS, 2*l.YS+12*l.YOFFSET))
|
self.setSize(l.XM + (2 + self.ROWS) * l.XS, l.YM
|
||||||
|
+ max(4.5 * l.YS, 2 * l.YS + 12 * l.YOFFSET))
|
||||||
|
|
||||||
x, y = l.XM, l.YM
|
x, y = l.XM, l.YM
|
||||||
s.talon = WasteTalonStack(x, y, self, max_rounds=1)
|
s.talon = WasteTalonStack(x, y, self, max_rounds=1)
|
||||||
|
@ -845,17 +852,18 @@ class Squadron(FortyThieves):
|
||||||
x += l.XS
|
x += l.XS
|
||||||
s.waste = WasteStack(x, y, self)
|
s.waste = WasteStack(x, y, self)
|
||||||
l.createText(s.waste, 's')
|
l.createText(s.waste, 's')
|
||||||
x += 2*l.XS
|
x += 2 * l.XS
|
||||||
for i in range(8):
|
for i in range(4 * decks):
|
||||||
s.foundations.append(SS_FoundationStack(x, y, self, suit=i//2))
|
s.foundations.append(self.Foundation_Class(x, y, self,
|
||||||
|
suit=i // decks))
|
||||||
x += l.XS
|
x += l.XS
|
||||||
x, y = l.XM, l.YM+l.YS*3//2
|
x, y = l.XM, l.YM + l.YS * 3//2
|
||||||
for i in range(3):
|
for i in range(self.RESERVES):
|
||||||
s.reserves.append(ReserveStack(x, y, self))
|
s.reserves.append(ReserveStack(x, y, self))
|
||||||
y += l.YS
|
y += l.YS
|
||||||
x, y = l.XM+2*l.XS, l.YM+l.YS
|
x, y = l.XM+2*l.XS, l.YM+l.YS
|
||||||
for i in range(10):
|
for i in range(self.ROWS):
|
||||||
s.rows.append(SS_RowStack(x, y, self, max_move=1))
|
s.rows.append(self.RowStack_Class(x, y, self, max_move=1))
|
||||||
x += l.XS
|
x += l.XS
|
||||||
|
|
||||||
l.defaultStackGroups()
|
l.defaultStackGroups()
|
||||||
|
@ -867,6 +875,23 @@ class Squadron(FortyThieves):
|
||||||
self.s.talon.dealCards() # deal first card to WasteStack
|
self.s.talon.dealCards() # deal first card to WasteStack
|
||||||
|
|
||||||
|
|
||||||
|
# ************************************************************************
|
||||||
|
# * Cascade
|
||||||
|
# ************************************************************************
|
||||||
|
|
||||||
|
class Cascade(Squadron):
|
||||||
|
RowStack_Class = AC_RowStack
|
||||||
|
Foundation_Class = AC_FoundationStack
|
||||||
|
|
||||||
|
ROWS = 7
|
||||||
|
RESERVES = 2
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
self._startDealNumRows(4)
|
||||||
|
self.s.talon.dealRow()
|
||||||
|
self.s.talon.dealCards() # deal first card to WasteStack
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Jacks in the Box
|
# * Jacks in the Box
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -1561,3 +1586,5 @@ registerGame(GameInfo(895, Preference, "Preference",
|
||||||
GI.GT_FORTY_THIEVES, 1, 0, GI.SL_LUCK))
|
GI.GT_FORTY_THIEVES, 1, 0, GI.SL_LUCK))
|
||||||
registerGame(GameInfo(910, NapoleonsShoulder, "Napoleon's Shoulder",
|
registerGame(GameInfo(910, NapoleonsShoulder, "Napoleon's Shoulder",
|
||||||
GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))
|
GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))
|
||||||
|
registerGame(GameInfo(933, Cascade, "Cascade",
|
||||||
|
GI.GT_FORTY_THIEVES, 1, 0, GI.SL_BALANCED))
|
||||||
|
|
Loading…
Add table
Reference in a new issue