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

Added Alexander the Great game.

This commit is contained in:
Joe R 2023-10-14 12:58:48 -04:00
parent 901a04bbb4
commit 05fc7a8baa
3 changed files with 37 additions and 10 deletions
html-src/rules
pysollib

View file

@ -0,0 +1,12 @@
<h1>Alexander the Great</h1>
<p>
Fan game type. 1 deck. No redeal.
<h3>Object</h3>
<p>
Move all cards to the foundations.
<h3>Quick Description</h3>
<p>
Just like <a href="cloverleaf.html">Clover Leaf</a>,
but with twelve piles of four cards each.

View file

@ -491,7 +491,7 @@ class GI:
("Peter Voke", (876,)), ("Peter Voke", (876,)),
("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359, ("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359,
415, 427, 458, 495, 496, 497, 508, 415, 427, 458, 495, 496, 497, 508,
800, 814, 820, 825, 889, 911,)), 800, 814, 820, 825, 889, 911, 926)),
("Mary Whitmore Jones", (421, 624,)), ("Mary Whitmore Jones", (421, 624,)),
("Jan Wolter", (917,)), ("Jan Wolter", (917,)),
) )
@ -576,7 +576,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, 926)) + tuple(range(11017, 11020)) + ('dev', tuple(range(906, 927)) + tuple(range(11017, 11020)) +
tuple(range(22303, 22311)) + tuple(range(22353, 22361))), tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
) )

View file

@ -525,6 +525,7 @@ class HouseOnTheHill(HouseInTheWood):
# ************************************************************************ # ************************************************************************
# * Clover Leaf # * Clover Leaf
# * Alexander the Great
# ************************************************************************ # ************************************************************************
class CloverLeaf_RowStack(UD_SS_RowStack): class CloverLeaf_RowStack(UD_SS_RowStack):
@ -540,20 +541,21 @@ class CloverLeaf_RowStack(UD_SS_RowStack):
class CloverLeaf(Game): class CloverLeaf(Game):
Hint_Class = Fan_Hint Hint_Class = Fan_Hint
# #
# game layout # game layout
# #
def createGame(self): def createGame(self, cols=4):
# create layout # create layout
l, s = Layout(self), self.s l, s = Layout(self), self.s
# set window # set window
playcards = 7 playcards = 7
w, h = l.XM+l.XS+4*(l.XS+(playcards-1)*l.XOFFSET), l.YM+4*l.YS w, h = ((2 * l.XM) + l.XS + cols *
(l.XS + (playcards - 1) * l.XOFFSET)), \
l.YM + 4 * l.YS
self.setSize(w, h) self.setSize(w, h)
# create stacks # create stacks
@ -562,12 +564,12 @@ class CloverLeaf(Game):
s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
y += l.YS y += l.YS
for i in range(2): for i in range(2):
s.foundations.append(SS_FoundationStack(x, y, self, suit=i+2, s.foundations.append(SS_FoundationStack(x, y, self, suit=i + 2,
base_rank=KING, dir=-1)) base_rank=KING, dir=-1))
y += l.YS y += l.YS
x = l.XM+l.XS x = (2 * l.XM) + l.XS
for i in range(4): for i in range(cols):
y = l.YM y = l.YM
for j in range(4): for j in range(4):
stack = CloverLeaf_RowStack(x, y, self, stack = CloverLeaf_RowStack(x, y, self,
@ -575,9 +577,9 @@ class CloverLeaf(Game):
s.rows.append(stack) s.rows.append(stack)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
y += l.YS y += l.YS
x += l.XS+(playcards-1)*l.XOFFSET x += l.XS + (playcards - 1) * l.XOFFSET
s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self) s.talon = InitialDealTalonStack(w - l.XS, h - l.YS, self)
# default # default
l.defaultAll() l.defaultAll()
@ -601,6 +603,17 @@ class CloverLeaf(Game):
shallHighlightMatch = Game._shallHighlightMatch_SS shallHighlightMatch = Game._shallHighlightMatch_SS
class AlexanderTheGreat(CloverLeaf):
def createGame(self):
CloverLeaf.createGame(self, cols=3)
def startGame(self):
self._startDealNumRows(3)
self.s.talon.dealRow()
self.s.talon.dealRow(rows=self.s.foundations)
# ************************************************************************ # ************************************************************************
# * Free Fan # * Free Fan
# ************************************************************************ # ************************************************************************
@ -1181,3 +1194,5 @@ registerGame(GameInfo(894, Cromwell, "Cromwell",
GI.GT_FAN_TYPE | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL)) GI.GT_FAN_TYPE | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(908, OpenProils, "Open Proils", registerGame(GameInfo(908, OpenProils, "Open Proils",
GI.GT_FAN_TYPE, 1, 0, GI.SL_BALANCED)) GI.GT_FAN_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(926, AlexanderTheGreat, "Alexander the Great",
GI.GT_FAN_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))