Skip to content

Commit

Permalink
Added Stewart game.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Aug 13, 2023
1 parent f0fb050 commit a8c34cd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
5 changes: 5 additions & 0 deletions html-src/rules/martha.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ <h3>Object</h3>
<h3>Rules</h3>
<p>
The four Aces are dealt to the foundations at game start.
The remaining cards are dealt to twelve piles of four cards
each, with alternating cards face-down.
<p>
The piles build down by alternate color.
Sequences may be moved, but an empty pile can be only
be filled with a <i>single</i> card.
<p>
The foundations are built up by same suit. The game is
won when all cards are moved to the foundations.
12 changes: 12 additions & 0 deletions html-src/rules/stewart.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<h1>Stewart</h1>
<p>
Baker's Dozen type. 1 deck. No redeal.

<h3>Object</h3>
<p>
Move all cards to the foundations.

<h3>Quick Description</h3>
<p>
Just like <a href="martha.html">Martha</a>,
but only single cards can be moved.
20 changes: 10 additions & 10 deletions pysollib/gamedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,21 +424,21 @@ def _callback(gi, gt=game_type):
# Nationale, Oasis, Opera, Ordered Suits, Osmotic FreeCell,
# Pair FreeCell, Pairs 2, Petal, Reserved Thirteens,
# Sea Spider, Sept Piles 0, Short Solitaire,
# Simple Alternations, Smart Osmosis, Step By Step, Strategy 7,
# Simple Alternations, Smart Osmosis, Step By Step,
# Stripped FreeCell, Tarantula, Triple Dispute, Trusty Twenty,
# Two Ways 3, Up Or Down, Versailles, Vertical FreeCell,
# Wasp Baby, Yukon FreeCell
("XM Solitaire", (
2, 8, 9, 13, 15, 18, 19, 20, 29, 30, 31, 34, 36, 38, 41, 42,
45, 46, 50, 53, 54, 56, 57, 64, 77, 78, 86, 96, 97, 98, 105,
110, 112, 124, 145, 220, 222, 223, 224, 228, 231, 233, 234,
235, 236, 257, 258, 264, 265, 267, 270, 271, 290, 291, 292,
303, 309, 314, 318, 320, 322, 324, 325, 336, 338, 341, 363,
364, 372, 376, 383, 384, 385, 386, 390, 391, 393, 398, 405,
415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480, 484,
511, 512, 513, 516, 561, 610, 625, 629, 631, 638, 641, 647,
650, 655, 678, 684, 734, 751, 784, 825, 829, 834, 837, 844,
862, 867, 880, 889, 901,
110, 112, 124, 145, 173, 220, 222, 223, 224, 228, 231, 233,
234, 235, 236, 257, 258, 264, 265, 267, 270, 271, 290, 291,
292, 303, 309, 314, 318, 320, 322, 324, 325, 336, 338, 341,
363, 364, 372, 376, 383, 384, 385, 386, 390, 391, 393, 398,
405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476, 480,
484, 511, 512, 513, 516, 561, 610, 625, 629, 631, 638, 641,
647, 650, 655, 678, 684, 734, 751, 784, 825, 829, 834, 837,
844, 862, 867, 880, 889, 901,
)),

# xpat2 1.06 (we have 14 out of 16 games)
Expand Down 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, 907))),
('dev', tuple(range(906, 908))),
)

# deprecated - the correct way is to or a GI.GT_XXX flag
Expand Down
7 changes: 7 additions & 0 deletions pysollib/games/bakersdozen.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def startGame(self, flip=(0, 0, 0)):

# ************************************************************************
# * Martha
# * Stewart
# ************************************************************************

class Martha_RowStack(AC_RowStack):
Expand Down Expand Up @@ -118,6 +119,10 @@ def startGame(self):
self.s.talon.dealRow(rows=self.s.foundations)


class Stewart(Martha):
RowStack_Class = StackWrapper(AC_RowStack, max_move=1, max_accept=1)


# ************************************************************************
# * Baker's Dozen
# ************************************************************************
Expand Down Expand Up @@ -446,3 +451,5 @@ def startGame(self):
registerGame(GameInfo(876, Vineyard, "Vineyard",
GI.GT_BAKERS_DOZEN | GI.GT_OPEN, 1, 0,
GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(907, Martha, "Stewart",
GI.GT_BAKERS_DOZEN, 1, 0, GI.SL_BALANCED))

0 comments on commit a8c34cd

Please sign in to comment.