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

Added Six by Six game.

This commit is contained in:
Joe R 2023-01-28 13:06:48 -05:00
parent 03de3e84a6
commit efbb3489b3
12 changed files with 80 additions and 9 deletions

View file

@ -0,0 +1,14 @@
<h1>Six by Six</h1>
<p>
One-Deck game type. 1 deck. No redeal.
<h3>Object</h3>
<p>
Move all cards to the foundations.
<h3>Quick Description</h3>
<p>
Like <a href="thirtysix.html">Thirty Six</a>,
but cards from the talon are dealt straight to the
first tableau pile, and only same suit sequences
can be moved between tableau piles.

View file

@ -9,10 +9,10 @@ Move all cards to the foundations.
<h3>Rules</h3> <h3>Rules</h3>
<p> <p>
Cards are dealt to six tableau piles of six cards Cards are dealt to six tableau piles of six cards
each. During the initial deal, any card that would be each. During the initial deal, any ace that would be
dealt but can be moved to a foundation is moved there dealt is instead moved to the foundation immediately.
immediately. Tableau piles are built down by rank, Tableau piles are built down by rank, regardless of
regardless of suit. suit.
<p> <p>
Cards can be dealt from the talon one at a time. No Cards can be dealt from the talon one at a time. No
redeal is allowed. redeal is allowed.

View file

@ -1698,6 +1698,9 @@ msgstr "Ablegen in Zwischentalon"
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "Lege auf das Tableau" msgstr "Lege auf das Tableau"
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "Lege in die Reserve" msgstr "Lege in die Reserve"

View file

@ -1728,6 +1728,9 @@ msgstr "Distribuer à la défausse"
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "Distribuer au tableau" msgstr "Distribuer au tableau"
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "Distribuer aux réserves" msgstr "Distribuer aux réserves"

View file

@ -1736,6 +1736,9 @@ msgstr "Manda nel pozzo"
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "Manda nel tableau" msgstr "Manda nel tableau"
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "Manda nella riserva" msgstr "Manda nella riserva"

View file

@ -1732,6 +1732,9 @@ msgstr "Przełóż do zrzutu"
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "Przełóż na stół gry" msgstr "Przełóż na stół gry"
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "Przełóż na stos rezerwowy" msgstr "Przełóż na stos rezerwowy"

View file

@ -1620,6 +1620,9 @@ msgstr ""
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "" msgstr ""
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "" msgstr ""

View file

@ -1728,6 +1728,9 @@ msgstr "Сдавать на сброс"
msgid "Deal to tableau" msgid "Deal to tableau"
msgstr "Сдавать на игровой стол" msgstr "Сдавать на игровой стол"
msgid "Deal to first tableau"
msgstr ""
#: pysollib/wizardutil.py:142 #: pysollib/wizardutil.py:142
msgid "Deal to reserves" msgid "Deal to reserves"
msgstr "Сдавать на резервные ячейки" msgstr "Сдавать на резервные ячейки"

View file

@ -378,8 +378,7 @@ class GI:
# Solitude for Windows # Solitude for Windows
# still missing: # still missing:
# Bowling (Sackson version), Four Kingdoms, Icicles, # Bowling (Sackson version), Four Kingdoms, Icicles
# Six By Six
("Solitude for Windows", ( ("Solitude for Windows", (
2, 8, 11, 13, 19, 24, 25, 29, 30, 31, 33, 34, 36, 38, 42, 2, 8, 11, 13, 19, 24, 25, 29, 30, 31, 33, 34, 36, 38, 42,
43, 45, 48, 50, 53, 56, 57, 58, 62, 64, 67, 69, 71, 86, 87, 43, 45, 48, 50, 53, 56, 57, 58, 62, 64, 67, 69, 71, 86, 87,
@ -387,7 +386,7 @@ class GI:
128, 133, 134, 135, 139, 146, 147, 171, 172, 173, 221, 222, 128, 133, 134, 135, 139, 146, 147, 171, 172, 173, 221, 222,
224, 228, 233, 234, 235, 256, 257, 258, 282, 314, 327, 330, 224, 228, 233, 234, 235, 256, 257, 258, 282, 314, 327, 330,
355, 356, 398, 406, 414, 418, 434, 437, 484, 593, 715, 716, 355, 356, 398, 406, 414, 418, 434, 437, 484, 593, 715, 716,
737, 751, 805, 830, 845, 847, 901, 903 737, 751, 805, 830, 845, 847, 888, 901, 903
)), )),
# XM Solitaire # XM Solitaire
@ -552,7 +551,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, 888))) ('dev', tuple(range(855, 889)))
) )
# 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

@ -35,6 +35,7 @@ from pysollib.pysoltk import MfxCanvasText
from pysollib.stack import \ from pysollib.stack import \
AC_RowStack, \ AC_RowStack, \
BO_RowStack, \ BO_RowStack, \
DealFirstRowTalonStack, \
DealRowTalonStack, \ DealRowTalonStack, \
InitialDealTalonStack, \ InitialDealTalonStack, \
KingAC_RowStack, \ KingAC_RowStack, \
@ -905,6 +906,7 @@ class Lanes(Klondike):
# ************************************************************************ # ************************************************************************
# * Thirty Six # * Thirty Six
# * Six By Six
# ************************************************************************ # ************************************************************************
class ThirtySix(Klondike): class ThirtySix(Klondike):
@ -920,7 +922,7 @@ class ThirtySix(Klondike):
if r.cards: if r.cards:
c = r.cards[-1] c = r.cards[-1]
for f in self.s.foundations: for f in self.s.foundations:
if f.acceptsCards(r, [c]): if f.acceptsCards(r, [c]) and c.rank == ACE:
self.moveMove(1, r, f, frames=4, shadow=0) self.moveMove(1, r, f, frames=4, shadow=0)
return 1 return 1
return 0 return 0
@ -937,6 +939,23 @@ class ThirtySix(Klondike):
shallHighlightMatch = Game._shallHighlightMatch_RK shallHighlightMatch = Game._shallHighlightMatch_RK
class SixBySix(ThirtySix):
Talon_Class = StackWrapper(DealFirstRowTalonStack, max_move=0)
RowStack_Class = StackWrapper(Spider_SS_RowStack, base_rank=ANY_RANK)
def createGame(self):
Klondike.createGame(self, rows=6, max_rounds=1, waste=0)
def startGame(self):
self.startDealSample()
for i in range(6):
self.s.talon.dealRow()
while True:
if not self._fillOne():
break
# ************************************************************************ # ************************************************************************
# * Q.C. # * Q.C.
# ************************************************************************ # ************************************************************************
@ -1656,3 +1675,5 @@ registerGame(GameInfo(869, Smokey, "Smokey",
GI.GT_KLONDIKE, 1, 2, GI.SL_BALANCED)) GI.GT_KLONDIKE, 1, 2, GI.SL_BALANCED))
registerGame(GameInfo(873, AgnesTwo, "Agnes Two", registerGame(GameInfo(873, AgnesTwo, "Agnes Two",
GI.GT_RAGLAN, 2, 0, GI.SL_BALANCED)) GI.GT_RAGLAN, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(888, SixBySix, "Six by Six",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))

View file

@ -1994,6 +1994,12 @@ class DealRowTalonStack(TalonStack):
return self.dealRowAvail(sound=sound) return self.dealRowAvail(sound=sound)
# A single click deals one card to each of the RowStacks.
class DealFirstRowTalonStack(TalonStack):
def dealCards(self, sound=False):
return self.dealRowAvail(sound=sound, rows=(self.game.s.rows[0],))
# For games where the Talon is only used for the initial dealing. # For games where the Talon is only used for the initial dealing.
class InitialDealTalonStack(TalonStack): class InitialDealTalonStack(TalonStack):
# no bindings # no bindings
@ -2048,6 +2054,17 @@ class DealRowRedealTalonStack(TalonStack, RedealCards_StackMethods):
rows=rows, shuffle=True) rows=rows, shuffle=True)
class DealFirstRowRedealTalonStack(DealRowRedealTalonStack):
def canDealCards(self, rows=None):
return DealRowRedealTalonStack.canDealCards(
self, rows=self.game.s.reserves)
def dealCards(self, sound=False, rows=None):
return DealRowRedealTalonStack.dealCards(
self, sound=sound, rows=(self.game.s.rows[0],))
class DealReserveRedealTalonStack(DealRowRedealTalonStack): class DealReserveRedealTalonStack(DealRowRedealTalonStack):
def canDealCards(self, rows=None): def canDealCards(self, rows=None):

View file

@ -31,6 +31,7 @@ from pysollib.stack import AC_FoundationStack, \
BO_FoundationStack, \ BO_FoundationStack, \
BO_RowStack, \ BO_RowStack, \
BasicRowStack, \ BasicRowStack, \
DealFirstRowRedealTalonStack, \
DealReserveRedealTalonStack, \ DealReserveRedealTalonStack, \
DealRowRedealTalonStack, \ DealRowRedealTalonStack, \
GroundsForADivorceTalonStack, \ GroundsForADivorceTalonStack, \
@ -148,6 +149,7 @@ TalonType = WizSetting(
values_map=((n_('Deal all cards at the beginning'), InitialDealTalonStack), values_map=((n_('Deal all cards at the beginning'), InitialDealTalonStack),
(n_('Deal to waste'), WasteTalonStack), (n_('Deal to waste'), WasteTalonStack),
(n_('Deal to tableau'), DealRowRedealTalonStack), (n_('Deal to tableau'), DealRowRedealTalonStack),
(n_('Deal to first tableau'), DealFirstRowRedealTalonStack),
(n_('Deal to reserves'), DealReserveRedealTalonStack), (n_('Deal to reserves'), DealReserveRedealTalonStack),
(n_('Spider'), SpiderTalonStack), (n_('Spider'), SpiderTalonStack),
(n_('Grounds for a Divorce'), GroundsForADivorceTalonStack), (n_('Grounds for a Divorce'), GroundsForADivorceTalonStack),