mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added Club game.
This commit is contained in:
parent
c11f57ce11
commit
dc985d5882
3 changed files with 96 additions and 3 deletions
25
html-src/rules/club.html
Normal file
25
html-src/rules/club.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<h1>Club</h1>
|
||||
<p>
|
||||
Fan game type. 2 decks. No redeal.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the foundations.
|
||||
|
||||
<h3>Rules</h3>
|
||||
<p>
|
||||
Three cards are dealt to each of eleven piles, the first one
|
||||
face-down, and the remaining two face-up. The piles are grouped
|
||||
into one set of three and the remaining eight.
|
||||
<p>
|
||||
Tableau piles are built down by alternate color. Only single cards
|
||||
can be moved between the tableau piles, and any card can fill an
|
||||
empty pile. However, under no circumstances can a card from the
|
||||
top three piles be moved to any of the remaining eight.
|
||||
<p>
|
||||
When there are no moves left, cards can be dealt from the talon one
|
||||
at a time, and moved to an appropriate tableau or foundation pile.
|
||||
No redeal is allowed.
|
||||
<p>
|
||||
The foundations are built up by same suit from ace to king. The
|
||||
game is won when all cards are moved to the foundations.
|
|
@ -435,7 +435,7 @@ class GI:
|
|||
# still missing:
|
||||
# Ace of Hearts, Agnes Three, Antares, Avenue, Baker's Fan,
|
||||
# Baker's Spider, Bedeviled, Binding, Black Spider,
|
||||
# California, Club, Color Cell, Cornelius, Desert Fox,
|
||||
# California, Color Cell, Cornelius, Desert Fox,
|
||||
# Double Antares, Double Antarctica, Double Arctica,
|
||||
# Double Baker's Spider, Double Cascade, Double Majesty,
|
||||
# Double Spidercells, Doublet Cell 5, Doubt, Dream Fan,
|
||||
|
@ -461,7 +461,8 @@ class GI:
|
|||
398, 405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476,
|
||||
480, 484, 511, 512, 513, 516, 561, 610, 613, 625, 629, 631,
|
||||
638, 641, 647, 650, 655, 678, 684, 702, 734, 751, 784, 825,
|
||||
829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933, 941
|
||||
829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933, 941,
|
||||
947
|
||||
)),
|
||||
|
||||
# xpat2 1.06 (we have 14 out of 16 games)
|
||||
|
@ -593,7 +594,7 @@ class GI:
|
|||
('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, 947)) + tuple(range(11017, 11020)) +
|
||||
('dev', tuple(range(906, 948)) + tuple(range(11017, 11020)) +
|
||||
tuple(range(5600, 5624)) + tuple(range(18000, 18005)) +
|
||||
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
|
||||
)
|
||||
|
|
|
@ -864,6 +864,71 @@ class Skippy(Canfield):
|
|||
shallHighlightMatch = Game._shallHighlightMatch_RKW
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Club
|
||||
# ************************************************************************
|
||||
|
||||
class Club_RowStack(AC_RowStack):
|
||||
def acceptsCards(self, from_stack, cards):
|
||||
if self.id > 2 and from_stack.id < 3:
|
||||
return False
|
||||
return AC_RowStack.acceptsCards(self, from_stack, cards)
|
||||
|
||||
|
||||
class Club(Game):
|
||||
|
||||
def createGame(self):
|
||||
# create layout
|
||||
lay, s = Layout(self), self.s
|
||||
|
||||
# set window
|
||||
playcards = 8
|
||||
w0 = lay.XS+playcards*lay.XOFFSET
|
||||
w = lay.XM+lay.XS//2+max(10*lay.XS, lay.XS+4*w0)
|
||||
h = lay.YM+4*lay.YS+lay.TEXT_HEIGHT
|
||||
self.setSize(w, h)
|
||||
|
||||
# create stacks
|
||||
y = lay.YM + lay.YS + lay.TEXT_HEIGHT
|
||||
x = lay.XM + lay.XS + lay.XS // 2 + (w0 // 2)
|
||||
for j in range(3):
|
||||
stack = Club_RowStack(x, y, self, max_move=1)
|
||||
s.rows.append(stack)
|
||||
stack.CARD_XOFFSET, stack.CARD_YOFFSET = lay.XOFFSET, 0
|
||||
x += w0
|
||||
y += lay.YS
|
||||
for i in range(2):
|
||||
x = lay.XM + lay.XS + lay.XS // 2
|
||||
for j in range(4):
|
||||
stack = Club_RowStack(x, y, self, max_move=1)
|
||||
s.rows.append(stack)
|
||||
stack.CARD_XOFFSET, stack.CARD_YOFFSET = lay.XOFFSET, 0
|
||||
x += w0
|
||||
y += lay.YS
|
||||
|
||||
x, y = lay.XM, lay.YM
|
||||
s.talon = WasteTalonStack(x, y, self, max_rounds=1)
|
||||
lay.createText(s.talon, 's')
|
||||
x += lay.XS
|
||||
s.waste = WasteStack(x, y, self)
|
||||
lay.createText(s.waste, 's')
|
||||
x = self.width - 8*lay.XS
|
||||
for i in range(8):
|
||||
s.foundations.append(SS_FoundationStack(x, y, self,
|
||||
suit=i % 4, mod=13))
|
||||
x += lay.XS
|
||||
|
||||
# define stack-groups
|
||||
lay.defaultStackGroups()
|
||||
|
||||
def startGame(self):
|
||||
self.startDealSample()
|
||||
self.s.talon.dealRow(rows=self.s.rows, flip=0, frames=0)
|
||||
self.s.talon.dealRow(rows=self.s.rows, flip=1, frames=0)
|
||||
self.s.talon.dealRow()
|
||||
self.s.talon.dealCards()
|
||||
|
||||
|
||||
# ************************************************************************
|
||||
# * Lafayette
|
||||
# ************************************************************************
|
||||
|
@ -1054,3 +1119,5 @@ registerGame(GameInfo(896, ThePlot, "The Plot",
|
|||
GI.GT_CANFIELD, 2, 0, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(922, QuadrupleCanfield, "Quadruple Canfield",
|
||||
GI.GT_CANFIELD, 4, -1, GI.SL_BALANCED))
|
||||
registerGame(GameInfo(947, Club, "Club",
|
||||
GI.GT_FAN_TYPE, 2, 0, GI.SL_BALANCED))
|
||||
|
|
Loading…
Add table
Reference in a new issue