Skip to content

Commit

Permalink
Refactoring of Hypotenuse and related games to remove unused parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Aug 26, 2023
1 parent d6b6eb6 commit f9024e5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
13 changes: 13 additions & 0 deletions html-src/rules/smalltriangle.html
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion pysollib/gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def _callback(gi, gt=game_type):
('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, 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
Expand Down
27 changes: 18 additions & 9 deletions pysollib/games/gypsy.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,21 +549,28 @@ class Hypotenuse(Gypsy):
Layout_Method = staticmethod(Layout.klondikeLayout)
RowStack_Class = KingAC_RowStack

def createGame(self):
Gypsy.createGame(self, rows=10, playcards=24)
def createGame(self, rows=10, playcards=24):
Gypsy.createGame(self, rows=rows, playcards=playcards)

def startGame(self, flip=0, reverse=1):
for i in range(1, 10):
self.s.talon.dealRow(rows=self.s.rows[:i], flip=0, frames=0)
def startGame(self, flip=0, rows=10):
for i in range(1, rows):
self.s.talon.dealRow(rows=self.s.rows[i:], flip=flip, frames=0)
self._startAndDealRow()


class EternalTriangle(Hypotenuse):

def startGame(self, flip=0, reverse=1):
for i in range(1, 10):
self.s.talon.dealRow(rows=self.s.rows[i:], frames=0)
self._startAndDealRow()
def startGame(self):
Hypotenuse.startGame(self, flip=1)


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):
Expand Down Expand Up @@ -1078,3 +1085,5 @@ def startGame(self):
GI.GT_GYPSY, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(890, YeastDough, "Yeast Dough",
GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(912, SmallTriangle, "Small Triangle",
GI.GT_GYPSY, 1, 0, GI.SL_BALANCED))

0 comments on commit f9024e5

Please sign in to comment.