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

Fixes for 23 Skidoo game and Accordion game organization.

This commit is contained in:
Joe R 2023-01-17 18:21:00 -05:00
parent b49dd96bc8
commit a04f24dfb7
2 changed files with 21 additions and 13 deletions

View file

@ -4,7 +4,7 @@ One deck type. 1 deck. No redeal.
<h3>Object</h3> <h3>Object</h3>
<p> <p>
Compress the entire deck into one pile. Compress the entire deck into two piles.
<h3>Quick Description</h3> <h3>Quick Description</h3>
<p> <p>
@ -12,3 +12,7 @@ Like <a href="accordion.html">Accordion</a>,
but you only move cards if they are separated by but you only move cards if they are separated by
one or two cards, not if they are right next to one or two cards, not if they are right next to
each other. each other.
<p>
Because of this, the game is won when there are
only two piles left (it is impossible to get only
one pile under these rules).

View file

@ -233,22 +233,19 @@ class RoyalMarriage(PushPin):
return cards return cards
class Queens(PushPin):
def startGame(self):
self._startAndDealRow()
# ************************************************************************ # ************************************************************************
# * Bayan (ex. Accordion) # * Bayan (ex. Accordion)
# ************************************************************************ # ************************************************************************
class Accordion_Hint(AbstractHint): class Accordion_Hint(AbstractHint):
VAL1 = 1
VAL2 = 3
def computeHints(self): def computeHints(self):
game = self.game game = self.game
rows = game.s.rows rows = game.s.rows
for i in range(len(rows)-3): for i in range(len(rows)-3):
r1, r2 = rows[i], rows[i+1] r1, r2 = rows[i], rows[i + self.VAL1]
if r1.cards and r2.cards: if r1.cards and r2.cards:
c1, c2 = r1.cards[0], r2.cards[0] c1, c2 = r1.cards[0], r2.cards[0]
if c1.rank == c2.rank or c1.suit == c2.suit: if c1.rank == c2.rank or c1.suit == c2.suit:
@ -256,7 +253,7 @@ class Accordion_Hint(AbstractHint):
self.addHint(5000, 1, r1, r2) self.addHint(5000, 1, r1, r2)
if r1.acceptsCards(r2, [c2]): if r1.acceptsCards(r2, [c2]):
self.addHint(5000, 1, r2, r1) self.addHint(5000, 1, r2, r1)
r1, r2 = rows[i], rows[i+3] r1, r2 = rows[i], rows[i + self.VAL2]
if r1.cards and r2.cards: if r1.cards and r2.cards:
c1, c2 = r1.cards[0], r2.cards[0] c1, c2 = r1.cards[0], r2.cards[0]
if c1.rank == c2.rank or c1.suit == c2.suit: if c1.rank == c2.rank or c1.suit == c2.suit:
@ -338,12 +335,21 @@ class RelaxedAccordion(Accordion2):
# ************************************************************************ # ************************************************************************
class TwoThreeSkidoo_Hint(Accordion_Hint):
VAL1 = 2
VAL2 = 3
class TwoThreeSkidoo_RowStack(Accordion2_RowStack): class TwoThreeSkidoo_RowStack(Accordion2_RowStack):
ALLOWED_JUMPS = (2, 3) ALLOWED_JUMPS = (2, 3)
class TwoThreeSkidoo(Accordion2): class TwoThreeSkidoo(Accordion2):
RowStack_Class = TwoThreeSkidoo_RowStack RowStack_Class = TwoThreeSkidoo_RowStack
Hint_Class = TwoThreeSkidoo_Hint
def isGameWon(self):
return len(self.s.foundations[0].cards) == 50
# ************************************************************************ # ************************************************************************
# * Accordion's Revenge # * Accordion's Revenge
@ -465,20 +471,18 @@ class Decade(PushPin):
registerGame(GameInfo(287, PushPin, "Push Pin", registerGame(GameInfo(287, PushPin, "Push Pin",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK)) GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
altnames=('Queens')))
registerGame(GameInfo(288, RoyalMarriage, "Royal Marriage", registerGame(GameInfo(288, RoyalMarriage, "Royal Marriage",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK, GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
altnames=('Betrothal'))) altnames=('Betrothal')))
# registerGame(GameInfo(303, Queens, "Queens",
# GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
registerGame(GameInfo(656, Accordion, "Bayan", registerGame(GameInfo(656, Accordion, "Bayan",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL)) GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(772, Accordion2, "Accordion", registerGame(GameInfo(772, Accordion2, "Accordion",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL, GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL,
altnames=('Idle Year', 'Methuselah', 'Tower of Babel'))) altnames=('Idle Year', 'Methuselah', 'Tower of Babel')))
registerGame(GameInfo(773, RelaxedAccordion, "Relaxed Accordion", registerGame(GameInfo(773, RelaxedAccordion, "Relaxed Accordion",
GI.GT_1DECK_TYPE | GI.GT_RELAXED, 1, 0, GI.SL_SKILL, GI.GT_1DECK_TYPE | GI.GT_RELAXED, 1, 0, GI.SL_SKILL))
altnames=('Concertina')))
registerGame(GameInfo(811, AccordionsRevenge, "Accordion's Revenge", registerGame(GameInfo(811, AccordionsRevenge, "Accordion's Revenge",
GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL)) GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(816, Decade, "Decade", registerGame(GameInfo(816, Decade, "Decade",