mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Refactoring of Hypotenuse and related games to remove unused parameters.
This commit is contained in:
parent
d6b6eb6b98
commit
f9024e563a
3 changed files with 32 additions and 10 deletions
13
html-src/rules/smalltriangle.html
Normal file
13
html-src/rules/smalltriangle.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<h1>Small Triangle</h1>
|
||||||
|
<p>
|
||||||
|
Gypsy type. 1 deck. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="hypotenuse.html">Hypotenuse</a>, but with one deck
|
||||||
|
and seven tableau piles.
|
|
@ -565,7 +565,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, 912)) + tuple(range(11017, 11020))),
|
('dev', tuple(range(906, 913)) + tuple(range(11017, 11020))),
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -549,21 +549,28 @@ class Hypotenuse(Gypsy):
|
||||||
Layout_Method = staticmethod(Layout.klondikeLayout)
|
Layout_Method = staticmethod(Layout.klondikeLayout)
|
||||||
RowStack_Class = KingAC_RowStack
|
RowStack_Class = KingAC_RowStack
|
||||||
|
|
||||||
def createGame(self):
|
def createGame(self, rows=10, playcards=24):
|
||||||
Gypsy.createGame(self, rows=10, playcards=24)
|
Gypsy.createGame(self, rows=rows, playcards=playcards)
|
||||||
|
|
||||||
def startGame(self, flip=0, reverse=1):
|
def startGame(self, flip=0, rows=10):
|
||||||
for i in range(1, 10):
|
for i in range(1, rows):
|
||||||
self.s.talon.dealRow(rows=self.s.rows[:i], flip=0, frames=0)
|
self.s.talon.dealRow(rows=self.s.rows[i:], flip=flip, frames=0)
|
||||||
self._startAndDealRow()
|
self._startAndDealRow()
|
||||||
|
|
||||||
|
|
||||||
class EternalTriangle(Hypotenuse):
|
class EternalTriangle(Hypotenuse):
|
||||||
|
|
||||||
def startGame(self, flip=0, reverse=1):
|
def startGame(self):
|
||||||
for i in range(1, 10):
|
Hypotenuse.startGame(self, flip=1)
|
||||||
self.s.talon.dealRow(rows=self.s.rows[i:], frames=0)
|
|
||||||
self._startAndDealRow()
|
|
||||||
|
class SmallTriangle(Hypotenuse):
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
Hypotenuse.createGame(self, rows=7, playcards=20)
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
Hypotenuse.startGame(self, rows=7)
|
||||||
|
|
||||||
|
|
||||||
class RightTriangle_Talon(OpenStack, DealRowTalonStack):
|
class RightTriangle_Talon(OpenStack, DealRowTalonStack):
|
||||||
|
@ -1078,3 +1085,5 @@ registerGame(GameInfo(842, SwissPatience, "Swiss Patience",
|
||||||
GI.GT_GYPSY, 1, 0, GI.SL_BALANCED))
|
GI.GT_GYPSY, 1, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(890, YeastDough, "Yeast Dough",
|
registerGame(GameInfo(890, YeastDough, "Yeast Dough",
|
||||||
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
registerGame(GameInfo(912, SmallTriangle, "Small Triangle",
|
||||||
|
GI.GT_GYPSY, 1, 0, GI.SL_BALANCED))
|
||||||
|
|
Loading…
Add table
Reference in a new issue