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

Added Up and Up game.

This commit is contained in:
Joe R 2021-11-13 12:57:33 -05:00
parent c1a20c7668
commit 48af00fb7e
5 changed files with 81 additions and 6 deletions

View file

@ -0,0 +1,12 @@
<h1>Knotty Nines</h1>
<p>
One deck type. 1 deck. No redeal.
<h3>Object</h3>
<p>
Move all cards to the tableau.
<h3>Quick Description</h3>
<p>
Just like <a href="trustytwelve.html">Trusty Twelve</a>,
but with only nine tableau piles.

View file

@ -0,0 +1,16 @@
<h1>Trusty Twelve</h1>
<p>
One deck type. 1 deck. No redeal.
<h3>Object</h3>
<p>
Move all cards to the tableau.
<h3>Rules</h3>
<p>
Twelve cards are dealt to twelve tableau piles. Tableau piles are built
down in rank, regardless of suit. Cards may be moved between tableau
piles, one at a time. An empty tableau pile is filled with the top card
from the talon.
<p>
The game is won if all cards are moved to the tableau.

View file

@ -0,0 +1,21 @@
<h1>Up and Up</h1>
<p>
One deck type. 1 deck. No redeal.
<h3>Object</h3>
<p>
Move all cards to the tableau.
<h3>Rules</h3>
<p>
Ten cards are dealt to ten tableau piles. Tableau piles are built up in rank,
regardless of suit, wrapping from ace to king as necessary. Cards may be
moved between tableau piles, one at a time. An empty tableau pile is filled
with the top card from the talon. The top card of the talon is face-up and
can also be moved to tableau piles as needed.
<p>
The game is won if all cards are moved to the tableau.
<h3>Notes</h3>
<p>
Up and Up is a variation of <a href="trustytwelve.html">Trusty Twelve</a>.

View file

@ -479,7 +479,7 @@ class GI:
('fc-2.12', tuple(range(774, 811)) + (16681,) +
tuple(range(22217, 22219))),
('fc-2.14', tuple(range(811, 827))),
('fc-2.16', tuple(range(827, 833)))
('fc-2.16', tuple(range(827, 834)))
)
# deprecated - the correct way is to or a GI.GT_XXX flag

View file

@ -350,6 +350,7 @@ class BavarianPatience(GermanPatience):
# ************************************************************************
# * Trusty Twelve
# * Up and Up
# * Knotty Nines
# * Sweet Sixteen
# ************************************************************************
@ -372,15 +373,19 @@ class TrustyTwelve_Hint(AbstractHint):
class TrustyTwelve(Game):
Hint_Class = TrustyTwelve_Hint
TALON_CLASS = TalonStack
ROWSTACK_CLASS = RK_RowStack
def createGame(self, rows=12):
l, s = Layout(self), self.s
self.setSize(l.XM+(rows+1)*l.XS, l.YM+l.YS+12*l.YOFFSET)
self.setSize((2 * l.XM) + (rows + 1) * l.XS,
l.YM + l.YS + 12 * l.YOFFSET)
x, y = l.XM, l.YM
s.talon = TalonStack(x, y, self)
s.talon = self.TALON_CLASS(x, y, self)
l.createText(s.talon, "s")
x += l.XS
x += (l.XS + l.XM)
for i in range(rows):
s.rows.append(RK_RowStack(x, y, self, max_move=1))
s.rows.append(self.ROWSTACK_CLASS(x, y, self, max_move=1))
x += l.XS
l.defaultStackGroups()
@ -391,7 +396,8 @@ class TrustyTwelve(Game):
if not stack.cards and stack in self.s.rows:
if self.s.talon.cards:
old_state = self.enterState(self.S_FILL)
self.s.talon.flipMove()
if not self.s.talon.cards[-1].face_up:
self.s.talon.flipMove()
self.s.talon.moveMove(1, stack)
self.leaveState(old_state)
@ -401,6 +407,24 @@ class TrustyTwelve(Game):
shallHighlightMatch = Game._shallHighlightMatch_RK
class UpAndUp_TalonStack(OpenTalonStack):
rightclickHandler = OpenStack.rightclickHandler
doubleclickHandler = OpenStack.doubleclickHandler
class UpAndUp(TrustyTwelve):
TALON_CLASS = UpAndUp_TalonStack
ROWSTACK_CLASS = StackWrapper(RK_RowStack, mod=13, dir=1)
def createGame(self):
TrustyTwelve.createGame(self, rows=10)
self.sg.dropstacks.append(self.s.talon)
def startGame(self):
TrustyTwelve.startGame(self)
self.s.talon.fillStack()
class KnottyNines(TrustyTwelve):
def createGame(self):
TrustyTwelve.createGame(self, rows=9)
@ -613,3 +637,5 @@ registerGame(GameInfo(762, FourPacks, "Four Packs",
GI.GT_2DECK_TYPE, 2, 1, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(830, FireAndIce, "Fire and Ice",
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(833, UpAndUp, "Up and Up",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))