Exemplo n.º 1
0
def r(id, short_name, name=None, ncards=144, layout=None):
    assert layout
    if not name:
        name = "Mahjongg " + short_name
    classname = re.sub('\W', '', name)
    # create class
    gameclass = type(classname, (AbstractMahjonggGame, ), {})
    gameclass.L = layout
    gameclass.NCARDS = ncards
    decks, ranks, trumps = comp_cardset(ncards)
    gi = GameInfo(
        id,
        gameclass,
        name,
        GI.GT_MAHJONGG,
        4 * decks,
        0,  # GI.SL_MOSTLY_SKILL,
        category=GI.GC_MAHJONGG,
        short_name=short_name,
        suits=list(range(3)),
        ranks=list(range(ranks)),
        trumps=list(range(trumps)),
        si={
            "decks": decks,
            "ncards": ncards
        })
    gi.ncards = ncards
    gi.rules_filename = "mahjongg.html"
    registerGame(gi)
    return gi
Exemplo n.º 2
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_HEXADECK
    gi = GameInfo(id, gameclass, name, game_type, decks, redeals, skill_level,
                  suits=list(range(4)), ranks=list(range(16)),
                  trumps=list(range(4)))
    registerGame(gi)
    return gi
Exemplo n.º 3
0
def registerCustomGame(gameclass):

    s = get_settings(gameclass.SETTINGS)
    gameid = gameclass.SETTINGS['gameid']

    registerGame(
        GameInfo(gameid, gameclass, s['name'], GI.GT_CUSTOM | GI.GT_ORIGINAL,
                 s['decks'], s['redeals'], s['skill_level']))
Exemplo n.º 4
0
def registerCustomGame(gameclass):

    s = get_settings(gameclass.SETTINGS)
    gameid = gameclass.SETTINGS['gameid']

    registerGame(GameInfo(gameid, gameclass, s['name'],
                          GI.GT_CUSTOM | GI.GT_ORIGINAL,
                          s['decks'], s['redeals'], s['skill_level']))
Exemplo n.º 5
0
def r(id, gameclass, name, rules_filename="shisensho.html"):
    decks, ranks, trumps = comp_cardset(gameclass.NCARDS)
    gi = GameInfo(id, gameclass, name,
                  GI.GT_SHISEN_SHO, 4*decks, 0, GI.SL_MOSTLY_SKILL,
                  category=GI.GC_MAHJONGG, short_name=name,
                  suits=range(3), ranks=range(ranks), trumps=range(trumps),
                  si={"decks": decks, "ncards": gameclass.NCARDS})
    gi.ncards = gameclass.NCARDS
    gi.rules_filename = rules_filename
    registerGame(gi)
    return gi
Exemplo n.º 6
0
def r(id, gameclass, name, rules_filename="shisensho.html"):
    decks, ranks, trumps = comp_cardset(gameclass.NCARDS)
    gi = GameInfo(id, gameclass, name,
                  GI.GT_SHISEN_SHO, 4*decks, 0, GI.SL_MOSTLY_SKILL,
                  category=GI.GC_MAHJONGG, short_name=name,
                  suits=range(3), ranks=range(ranks), trumps=range(trumps),
                  si={"decks": decks, "ncards": gameclass.NCARDS})
    gi.ncards = gameclass.NCARDS
    gi.rules_filename = rules_filename
    registerGame(gi)
    return gi
Exemplo n.º 7
0
def r(id, gameclass, short_name):
    name = short_name
    ncards = int(name[:2]) * int(name[:2])
    gi = GameInfo(id, gameclass, name,
                GI.GT_MATRIX, 1, 0, GI.SL_SKILL,
                category=GI.GC_TRUMP_ONLY, short_name=short_name,
                suits=(), ranks=(), trumps=range(ncards),
                si = {"decks": 1, "ncards": ncards})
    gi.ncards = ncards
    gi.rules_filename = "matrix.html"
    registerGame(gi)
    return gi
Exemplo n.º 8
0
def r(id, gameclass, name):
    ncards = 0
    for n in gameclass.ROWS:
        ncards += n
    gi = GameInfo(id, gameclass, name,
                  GI.GT_PEGGED, 1, 0, GI.SL_SKILL,
                  category=GI.GC_TRUMP_ONLY,
                  suits=(), ranks=(), trumps=list(range(ncards)),
                  si={"decks": 1, "ncards": ncards},
                  rules_filename="pegged.html")
    registerGame(gi)
    return gi
Exemplo n.º 9
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_MUGHAL_GANJIFA
    gi = GameInfo(id,
                  gameclass,
                  name,
                  game_type,
                  decks,
                  redeals,
                  skill_level,
                  suits=range(8),
                  ranks=range(12))
    registerGame(gi)
    return gi
Exemplo n.º 10
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_DASHAVATARA_GANJIFA
    gi = GameInfo(id,
                  gameclass,
                  name,
                  game_type,
                  decks,
                  redeals,
                  skill_level,
                  suits=list(range(10)),
                  ranks=list(range(12)))
    registerGame(gi)
    return gi
Exemplo n.º 11
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_HANAFUDA
    gi = GameInfo(id,
                  gameclass,
                  name,
                  game_type,
                  decks,
                  redeals,
                  skill_level,
                  suits=list(range(12)),
                  ranks=list(range(4)))
    registerGame(gi)
    return gi
Exemplo n.º 12
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_TAROCK | GI.GT_CONTRIB | GI.GT_ORIGINAL
    gi = GameInfo(id,
                  gameclass,
                  name,
                  game_type,
                  decks,
                  redeals,
                  skill_level,
                  ranks=range(14),
                  trumps=range(22))
    registerGame(gi)
    return gi
Exemplo n.º 13
0
def r(id, gameclass, name):
    ncards = 0
    for n in gameclass.ROWS:
        ncards += n
    ncards -= 1
    gi = GameInfo(id, gameclass, name,
                  GI.GT_PUZZLE_TYPE, 1, 0, GI.SL_SKILL,
                  category=GI.GC_TRUMP_ONLY,
                  suits=(), ranks=(), trumps=list(range(ncards)),
                  si={"decks": 1, "ncards": ncards},
                  rules_filename="pegged.html")
    registerGame(gi)
    return gi
Exemplo n.º 14
0
def r(id, short_name, name=None, ncards=144, layout=None):
    assert layout
    if not name:
        name = "Mahjongg " + short_name
    classname = re.sub('\W', '', name)
    # create class
    gameclass = classobj(classname, (AbstractMahjonggGame,), {})
    gameclass.L = layout
    gameclass.NCARDS = ncards
    decks, ranks, trumps = comp_cardset(ncards)
    gi = GameInfo(id, gameclass, name,
                  GI.GT_MAHJONGG, 4*decks, 0, ##GI.SL_MOSTLY_SKILL,
                  category=GI.GC_MAHJONGG, short_name=short_name,
                  suits=range(3), ranks=range(ranks), trumps=range(trumps),
                  si={"decks": decks, "ncards": ncards})
    gi.ncards = ncards
    gi.rules_filename = "mahjongg.html"
    registerGame(gi)
    return gi
Exemplo n.º 15
0
def r(id, short_name, width):
    name = short_name
    ncards = width**2
    gi = GameInfo(id,
                  LightsOut,
                  name,
                  GI.GT_LIGHTS_OUT,
                  1,
                  0,
                  GI.SL_SKILL,
                  category=GI.GC_TRUMP_ONLY,
                  short_name=short_name,
                  suits=(),
                  ranks=(),
                  trumps=list(range(ncards)),
                  si={
                      "decks": 1,
                      "ncards": ncards
                  })
    gi.ncards = ncards
    gi.rules_filename = "lightsout.html"
    registerGame(gi)
    return gi
Exemplo n.º 16
0
def r(id, gameclass, short_name):
    name = short_name
    ncards = int(name[:2]) * int(name[:2])
    gi = GameInfo(id,
                  gameclass,
                  name,
                  GI.GT_MATRIX,
                  1,
                  0,
                  GI.SL_SKILL,
                  category=GI.GC_TRUMP_ONLY,
                  short_name=short_name,
                  suits=(),
                  ranks=(),
                  trumps=range(ncards),
                  si={
                      "decks": 1,
                      "ncards": ncards
                  })
    gi.ncards = ncards
    gi.rules_filename = "matrix.html"
    registerGame(gi)
    return gi
Exemplo n.º 17
0
            self.s.talon.dealRow(rows=[self.s.reserves[-1]], frames=0)
        for i in range(3):
            self.s.talon.dealRow(flip=0, frames=0)
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealCards()

    def dealCards(self, sound=True):
        # for demo-mode
        if self.demo:
            r = self.s.reserves[0]
            if r.canDealCards():
                ##self.demo.last_deal = [] # don't check last deal
                return r.dealCards(sound=sound)
        return Game.dealCards(self, sound=sound)

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game
registerGame(GameInfo(135, Terrace, "Terrace", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(136, GeneralsPatience, "General's Patience", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(137, BlondesAndBrunettes, "Blondes and Brunettes", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(138, FallingStar, "Falling Star", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(431, QueenOfItaly, "Queen of Italy", GI.GT_TERRACE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(499, Signora, "Signora", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(500, Madame, "Madame", GI.GT_TERRACE, 3, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(533, MamySusan, "Mamy Susan", GI.GT_TERRACE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(582, Wood, "Wood", GI.GT_TERRACE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(637, BastilleDay, "Bastille Day", GI.GT_TERRACE, 2, 0, GI.SL_BALANCED))
Exemplo n.º 18
0
        n = (104 - reserves - 2 * rows) // (reserves // 2)
        for i in range(n):
            self.s.talon.dealRow(rows=self.s.reserves2, frames=0, flip=0)
        self.s.talon.dealRow(rows=self.s.reserves, frames=0)
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealRow()

    def fillStack(self, stack):
        if stack in self.s.reserves and not stack.cards:
            si = list(self.s.reserves).index(stack)
            from_stack = self.s.reserves2[si // 2]
            if not from_stack.cards:
                return
            old_state = self.enterState(self.S_FILL)
            from_stack.flipMove()
            from_stack.moveMove(1, stack)
            self.leaveState(old_state)

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game

registerGame(
    GameInfo(307, HeadsAndTails, "Heads and Tails", GI.GT_2DECK_TYPE, 2, 0,
             GI.SL_BALANCED))
registerGame(
    GameInfo(708, Barrier, "Barrier", GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0,
             GI.SL_BALANCED))
Exemplo n.º 19
0
    def startGame(self):
        self.startDealSample()
        i = 0
        while self.s.talon.cards:
            r = self.s.talon.cards[-1].rank
            self.s.talon.dealRow(rows=[self.s.rows[i]], frames=4)
            if r == ACE:
                i += 1

    shallHighlightMatch = Game._shallHighlightMatch_RK



# register the game
registerGame(GameInfo(141, DerKatzenschwanz, "Cat's Tail",
                      GI.GT_FREECELL | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Der Katzenschwanz",) ))
registerGame(GameInfo(142, DieSchlange, "Snake",
                      GI.GT_FREECELL | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Die Schlange",) ))
registerGame(GameInfo(279, Kings, "Kings",
                      GI.GT_FREECELL | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(286, Retinue, "Retinue",
                      GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(299, SalicLaw, "Salic Law",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(442, Deep, "Deep",
                      GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(523, Intrigue, "Intrigue",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(611, FaerieQueen, "Faerie Queen",
Exemplo n.º 20
0
# ************************************************************************
# * Foothold
# ************************************************************************

class Foothold(FortyThieves):
    RowStack_Class = UD_AC_RowStack
    DEAL = (0, 5)
    def createGame(self):
        FortyThieves.createGame(self, rows=8, playcards=16)
    shallHighlightMatch = Game._shallHighlightMatch_AC



# register the game
registerGame(GameInfo(13, FortyThieves, "Forty Thieves",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Napoleon at St.Helena",
                                "Le Cadran")))
registerGame(GameInfo(80, BusyAces, "Busy Aces",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(228, Limited, "Limited",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(79, WaningMoon, "Waning Moon",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(125, Lucas, "Lucas",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(109, Deuces, "Deuces",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(196, Corona, "Corona",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(195, Quadrangle, "Quadrangle",
                      GI.GT_FORTY_THIEVES, 2, 0, GI.SL_BALANCED))
Exemplo n.º 21
0
        EightPacks.createGame(self, max_rounds=2, width=12, playcards=18)

    def isGameWon(self):
        if self.s.talon.cards or self.s.waste.cards:
            return False
        for s in self.s.rows:
            if s.cards:
                if s.cards[0].rank != ACE:
                    return False
                if len(s.cards) != 26:
                    return False
        return True


# register the game
registerGame(GameInfo(294, CurdsAndWhey, "Curds and Whey",
                      GI.GT_SPIDER | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(311, Dumfries, "Dumfries",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(312, Galloway, "Galloway",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(313, Robin, "Robin",
                      GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(348, Arachnida, "Arachnida",
                      GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(349, MissMuffet, "Miss Muffet",
                      GI.GT_SPIDER | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(352, Nordic, "Nordic",
                      GI.GT_SPIDER | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(414, GermanPatience, "German Patience",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(415, BavarianPatience, "Bavarian Patience",
Exemplo n.º 22
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_TAROCK | GI.GT_CONTRIB | GI.GT_ORIGINAL
    gi = GameInfo(id, gameclass, name, game_type, decks, redeals, skill_level,
                  ranks=list(range(14)), trumps=list(range(22)))
    registerGame(gi)
    return gi
Exemplo n.º 23
0
            self.s.talon.dealRow(frames=0)
        self.startDealSample()
        self.s.talon.dealRow()

    def shallHighlightMatch(self, stack1, card1, stack2, card2):
        if card1.rank != ACE and card2.rank != ACE:
            # by rank
            return abs(card1.rank-card2.rank) == 2
        return card1.rank == ACE and card2.rank == ACE

    getQuickPlayScore = Game._getSpiderQuickPlayScore



# register the game
registerGame(GameInfo(10, RelaxedSpider, "Relaxed Spider",
                      GI.GT_SPIDER | GI.GT_RELAXED, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(11, Spider, "Spider",
                      GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(49, BlackWidow, "Black Widow",
                      GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Scarab",) ))
registerGame(GameInfo(14, GroundsForADivorce, "Grounds for a Divorce",
                      GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL,
                      altnames=('Scheidungsgrund',) ))
registerGame(GameInfo(114, GrandmothersGame, "Grandmother's Game",
                      GI.GT_SPIDER, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(24, Spiderette, "Spiderette",
                      GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(47, BabySpiderette, "Baby Spiderette",
                      GI.GT_SPIDER, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(48, WillOTheWisp, "Will o' the Wisp",
Exemplo n.º 24
0
    def getAutoStacks(self, event=None):
        return ((), (), (self.sg.dropstacks))

    def isGameWon(self):
        for r in self.s.rows:
            if len(r.cards) != 1:
                return False
            c = r.cards[-1]
            if c.suit != r.id / 13 or c.rank != r.id % 13:
                return False
        return True

    #
    # game extras
    #

    def isNeighbour(self, stack1, stack2):
        column1, row1 = stack1.id % 13, stack1.id / 13
        column2, row2 = stack2.id % 13, stack2.id / 13
        return column1 == column2 or row1 == row2

    def getHighlightPilesStacks(self):
        # Pas de Deux special: highlight all moveable cards
        return ((self.s.rows, 1),)


# register the game
registerGame(GameInfo(153, PasDeDeux, "Pas de Deux",
                      GI.GT_MONTANA | GI.GT_SEPARATE_DECKS, 2, 1, GI.SL_MOSTLY_SKILL))

Exemplo n.º 25
0
# *   play similar to Yukon
# ************************************************************************


class Sanibel(Gypsy):
    Layout_Method = staticmethod(Layout.klondikeLayout)
    Talon_Class = StackWrapper(WasteTalonStack, max_rounds=1)
    Foundation_Class = StackWrapper(SS_FoundationStack, max_move=0)
    RowStack_Class = Yukon_AC_RowStack
    Hint_Class = Yukon_Hint

    def createGame(self):
        Gypsy.createGame(self, rows=10, waste=1, playcards=23)

    def startGame(self):
        for i in range(3):
            self.s.talon.dealRow(flip=0, frames=0)
        for i in range(6):
            self.s.talon.dealRow(frames=0)
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealCards()          # deal first card to WasteStack

    def getHighlightPilesStacks(self):
        return ()


registerGame(GameInfo(201, Sanibel, "Sanibel",
                      GI.GT_YUKON | GI.GT_CONTRIB | GI.GT_ORIGINAL, 2, 0,
                      GI.SL_MOSTLY_SKILL))
Exemplo n.º 26
0
# ************************************************************************

class DoubleDojoujisGame(DojoujisGame):
    MAX_ROW = 16

    def Max_Cards(self, i):
        return 16

    def Deal_Rows(self, i):
        return 16



# register the game
registerGame(GameInfo(13001, KatrinasGame, "Katrina's Game",
                      GI.GT_TAROCK, 2, 1, GI.SL_BALANCED,
                      ranks = range(14), trumps = range(22)))
registerGame(GameInfo(13002, BridgetsGame, "Bridget's Game",
                      GI.GT_HEXADECK, 2, 1, GI.SL_BALANCED,
                      ranks = range(16), trumps = range(4)))
registerGame(GameInfo(13003, FatimehsGame, "Fatimeh's Game",
                      GI.GT_MUGHAL_GANJIFA, 1, 2, GI.SL_BALANCED,
                      suits = range(8), ranks = range(12)))
registerGame(GameInfo(13004, KalisGame, "Kali's Game",
                      GI.GT_DASHAVATARA_GANJIFA, 1, 2, GI.SL_BALANCED,
                      suits = range(10), ranks = range(12)))
registerGame(GameInfo(13005, DojoujisGame, "Dojouji's Game",
                      GI.GT_HANAFUDA, 2, 0, GI.SL_BALANCED,
                      suits = range(12), ranks = range(4)))
registerGame(GameInfo(13008, RelaxedKatrinasGame, "Katrina's Game Relaxed",
                      GI.GT_TAROCK, 2, 1, GI.SL_BALANCED,
Exemplo n.º 27
0
    def getAutoStacks(self, event=None):
        return ((), (), (self.sg.dropstacks))

    def isGameWon(self):
        for r in self.s.rows:
            if len(r.cards) != 1:
                return False
            c = r.cards[-1]
            if c.suit != r.id / 13 or c.rank != r.id % 13:
                return False
        return True

    #
    # game extras
    #

    def isNeighbour(self, stack1, stack2):
        column1, row1 = stack1.id % 13, stack1.id / 13
        column2, row2 = stack2.id % 13, stack2.id / 13
        return column1 == column2 or row1 == row2

    def getHighlightPilesStacks(self):
        # Pas de Deux special: highlight all moveable cards
        return ((self.s.rows, 1), )


# register the game
registerGame(
    GameInfo(153, PasDeDeux, "Pas de Deux",
             GI.GT_MONTANA | GI.GT_SEPARATE_DECKS, 2, 1, GI.SL_MOSTLY_SKILL))
Exemplo n.º 28
0
                SS_FoundationStack(r.x, r.y, self, suit=r.suit))
        for r in l.s.rows:
            s.rows.append(Yukon_AC_RowStack(r.x, r.y, self))
        l.defaultAll()

    def startGame(self):
        self.s.talon.dealRow(frames=0)
        self.s.talon.dealRow(frames=0, flip=0)
        self.startDealSample()
        self.s.talon.dealRow()

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game
registerGame(GameInfo(19, Yukon, "Yukon", GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(20, RussianSolitaire, "Russian Solitaire", GI.GT_YUKON, 1, 0,
             GI.SL_BALANCED))
registerGame(GameInfo(27, Odessa, "Odessa", GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(278, Grandfather, "Grandfather", GI.GT_YUKON, 1, 2,
             GI.SL_BALANCED))
registerGame(GameInfo(186, Alaska, "Alaska", GI.GT_YUKON, 1, 0,
                      GI.SL_BALANCED))
registerGame(
    GameInfo(187, ChineseDiscipline, "Chinese Discipline",
             GI.GT_YUKON | GI.GT_XORIGINAL, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(188, ChineseSolitaire, "Chinese Solitaire",
             GI.GT_YUKON | GI.GT_XORIGINAL, 1, 0, GI.SL_BALANCED))
Exemplo n.º 29
0

    def startGame(self):
        for i in range(4):
            self.s.talon.dealRow(frames=0)
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealRow(rows=self.s.reserves)

    shallHighlightMatch = Game._shallHighlightMatch_RK
    getQuickPlayScore = Game._getSpiderQuickPlayScore



# register the game
registerGame(GameInfo(1, Gypsy, "Gypsy",
                      GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(65, Giant, "Giant",
                      GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(3, Irmgard, "Irmgard",
                      GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(119, DieKoenigsbergerin, "Die Koenigsbergerin",
                      GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(174, DieRussische, "Russian Patience",
                      GI.GT_2DECK_TYPE | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
                      ranks=(0, 6, 7, 8, 9, 10, 11, 12),
                      altnames=("Die Russische",) ))
registerGame(GameInfo(62, MissMilligan, "Miss Milligan",
                      GI.GT_GYPSY, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(200, Nomad, "Nomad",
                      GI.GT_GYPSY | GI.GT_CONTRIB | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(78, MilliganCell, "Milligan Cell",
Exemplo n.º 30
0
    def startGame(self):
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealCards()

    def fillStack(self, stack):
        if stack in self.s.rows and not stack.cards:
            old_state = self.enterState(self.S_FILL)
            if not self.s.waste.cards:
                self.s.talon.dealCards()
            if self.s.waste.cards:
                self.s.waste.moveMove(1, stack)
            self.leaveState(old_state)


# register the game
registerGame(GameInfo(280, Camelot, "Camelot",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(610, SlyFox, "Sly Fox",
                      GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(614, OpenSlyFox, "Open Sly Fox",
                      GI.GT_NUMERICA | GI.GT_ORIGINAL, 2, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(623, PrincessPatience, "Princess Patience",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(622, GrandmammasPatience, "Grandmamma's Patience",
                      GI.GT_NUMERICA, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(702, DoubleLine, "Double Line",
                      GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
Exemplo n.º 31
0
def r(id, gameclass, name, game_type, decks, redeals, skill_level):
    game_type = game_type | GI.GT_MUGHAL_GANJIFA
    gi = GameInfo(id, gameclass, name, game_type, decks, redeals, skill_level,
                  suits=list(range(8)), ranks=list(range(12)))
    registerGame(gi)
    return gi
Exemplo n.º 32
0
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealCards()

    def fillStack(self, stack):
        if stack in self.s.rows and not stack.cards:
            old_state = self.enterState(self.S_FILL)
            if not self.s.waste.cards:
                self.s.talon.dealCards()
            if self.s.waste.cards:
                self.s.waste.moveMove(1, stack)
            self.leaveState(old_state)


# register the game
registerGame(
    GameInfo(280, Camelot, "Camelot", GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(610, SlyFox, "Sly Fox", GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(614, OpenSlyFox, "Open Sly Fox", GI.GT_NUMERICA | GI.GT_ORIGINAL,
             2, 0, GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(623, PrincessPatience, "Princess Patience", GI.GT_2DECK_TYPE, 2,
             0, GI.SL_BALANCED))
registerGame(
    GameInfo(622, GrandmammasPatience, "Grandmamma's Patience", GI.GT_NUMERICA,
             2, 0, GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(702, DoubleLine, "Double Line", GI.GT_NUMERICA, 2, 0,
             GI.SL_BALANCED))
Exemplo n.º 33
0
                top.append(c)
        top.sort(lambda a, b: cmp(b.rank, a.rank))
        return cards + top[7:] + top[:7]

    def startGame(self):
        self.startDealSample()
        self.s.talon.dealRow(rows=self.s.foundations)
        self.s.talon.dealCards()


# register the game
registerGame(
    GameInfo(256,
             Calculation,
             "Calculation",
             GI.GT_1DECK_TYPE,
             1,
             0,
             GI.SL_MOSTLY_SKILL,
             altnames=("Progression", )))
registerGame(
    GameInfo(94, Hopscotch, "Hopscotch", GI.GT_1DECK_TYPE, 1, 0,
             GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(134,
             BetsyRoss,
             "Betsy Ross",
             GI.GT_1DECK_TYPE,
             1,
             2,
             GI.SL_MOSTLY_LUCK,
Exemplo n.º 34
0
class DoubleFootling(Footling):
    def createGame(self):
        Footling.createGame(self, rows=10, reserves=5, playcards=18)

    def startGame(self):
        self._startDealNumRows(9)
        self.s.talon.dealRow()
        self.s.talon.dealRowAvail()


# register the game
registerGame(
    GameInfo(41,
             PileOn,
             "PileOn",
             GI.GT_1DECK_TYPE | GI.GT_OPEN,
             1,
             0,
             GI.SL_MOSTLY_SKILL,
             altnames=("Fifteen Puzzle", )))
registerGame(
    GameInfo(289,
             SmallPileOn,
             "Small PileOn",
             GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL,
             1,
             0,
             GI.SL_MOSTLY_SKILL,
             ranks=(0, 5, 6, 7, 8, 9, 10, 11, 12),
             rules_filename="pileon.html"))
registerGame(
Exemplo n.º 35
0
    def startGame(self):
        self.base_card = self.s.talon.cards[-1]
        for s in self.s.foundations:
            s.cap.base_rank = self.base_card.rank
        # deal base card to Foundations
        c = self.s.talon.getCard()
        to_stack = self.s.foundations[c.suit * self.gameinfo.decks]
        self.flipMove(self.s.talon)
        self.moveMove(1, self.s.talon, to_stack, frames=0)
        # deal rows
        self._startAndDealRowAndCards()

    def _restoreGameHook(self, game):
        self.base_card = self.cards[game.loadinfo.base_card_id]
        for s in self.s.foundations:
            s.cap.base_rank = self.base_card.rank

    def _loadGameHook(self, p):
        self.loadinfo.addattr(base_card_id=None)    # register extra load var.
        self.loadinfo.base_card_id = p.load()

    def _saveGameHook(self, p):
        p.dump(self.base_card.id)

    shallHighlightMatch = Game._shallHighlightMatch_RKW


# register the game
registerGame(GameInfo(93, RoyalEast, "Royal East",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
Exemplo n.º 36
0
        self.s.talon.dealCards()

    def dealCards(self, sound=True):
        # for demo-mode
        if self.demo:
            r = self.s.reserves[0]
            if r.canDealCards():
                # self.demo.last_deal = [] # don't check last deal
                return r.dealCards(sound=sound)
        return Game.dealCards(self, sound=sound)

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game
registerGame(
    GameInfo(135, Terrace, "Terrace", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(136, GeneralsPatience, "General's Patience", GI.GT_TERRACE, 2, 0,
             GI.SL_MOSTLY_LUCK))
registerGame(
    GameInfo(137, BlondesAndBrunettes, "Blondes and Brunettes", GI.GT_TERRACE,
             2, 0, GI.SL_MOSTLY_LUCK))
registerGame(
    GameInfo(138, FallingStar, "Falling Star", GI.GT_TERRACE, 2, 0,
             GI.SL_MOSTLY_LUCK))
registerGame(
    GameInfo(431, QueenOfItaly, "Queen of Italy", GI.GT_TERRACE, 2, 0,
             GI.SL_BALANCED))
registerGame(
    GameInfo(499, Signora, "Signora", GI.GT_TERRACE, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(
Exemplo n.º 37
0
                from_stack = self.s.reserves[0]
                if from_stack.cards:
                    from_stack.flipMove()
                    from_stack.moveMove(1, stack)
            self.leaveState(old_state)

    shallHighlightMatch = Game._shallHighlightMatch_SS

    def getQuickPlayScore(self, ncards, from_stack, to_stack):
        if to_stack in self.s.xwastes:
            return 0
        return 1 + Game.getQuickPlayScore(self, ncards, from_stack, to_stack)


# register the game
registerGame(
    GameInfo(42, Bristol, "Bristol", GI.GT_FAN_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(214, Belvedere, "Belvedere", GI.GT_FAN_TYPE, 1, 0,
             GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(266, Dover, "Dover", GI.GT_FAN_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(425, NewYork, "New York", GI.GT_FAN_TYPE, 2, 0,
             GI.SL_MOSTLY_SKILL))
registerGame(
    GameInfo(468, Spike, "Spike", GI.GT_KLONDIKE, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(519, Gotham, "Gotham", GI.GT_FAN_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(604, Interment, "Interment", GI.GT_FAN_TYPE, 2, 0,
             GI.SL_BALANCED))
Exemplo n.º 38
0
    def getQuickPlayScore(self, ncards, from_stack, to_stack):
        return int(to_stack in self.s.rows)


# ************************************************************************
# * Penelope's Web
# ************************************************************************

class PenelopesWeb(StreetsAndAlleys):
    RowStack_Class = StackWrapper(RK_RowStack, base_rank=KING)
    Solver_Class = FreeCellSolverWrapper(sbb='rank', esf='kings')


# register the game
registerGame(GameInfo(146, StreetsAndAlleys, "Streets and Alleys",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(34, BeleagueredCastle, "Beleaguered Castle",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL,
                      altnames=("Laying Siege", "Sham Battle",)))
registerGame(GameInfo(145, Citadel, "Citadel",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(147, Fortress, "Fortress",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_SKILL))
registerGame(GameInfo(148, Chessboard, "Chessboard",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_SKILL))
registerGame(GameInfo(300, Stronghold, "Stronghold",
Exemplo n.º 39
0
    def createGame(self):
        DoubleKlondike.createGame(self, rows=10, max_rounds=1)

    def startGame(self):
        self._startDealNumRows(3)
        self.s.talon.dealRow()
        self.s.talon.dealCards()  # deal first card to WasteStack

    shallHighlightMatch = Game._shallHighlightMatch_RK
    getQuickPlayScore = Game._getSpiderQuickPlayScore


# register the game
registerGame(
    GameInfo(21, DoubleKlondike, "Double Klondike", GI.GT_KLONDIKE, 2, -1,
             GI.SL_BALANCED))
registerGame(
    GameInfo(28, DoubleKlondikeByThrees, "Double Klondike by Threes",
             GI.GT_KLONDIKE, 2, -1, GI.SL_MOSTLY_LUCK))
registerGame(
    GameInfo(25, Gargantua, "Gargantua", GI.GT_KLONDIKE, 2, 1, GI.SL_BALANCED))
registerGame(
    GameInfo(15, BigHarp, "Big Harp", GI.GT_KLONDIKE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(51, Steps, "Steps", GI.GT_KLONDIKE, 2, 1,
                      GI.SL_BALANCED))
registerGame(
    GameInfo(273, TripleKlondike, "Triple Klondike", GI.GT_KLONDIKE, 3, -1,
             GI.SL_BALANCED))
registerGame(
    GameInfo(274, TripleKlondikeByThrees, "Triple Klondike by Threes",
Exemplo n.º 40
0
    def getQuickPlayScore(self, ncards, from_stack, to_stack):
        return int(to_stack in self.s.rows)


# ************************************************************************
# * Penelope's Web
# ************************************************************************

class PenelopesWeb(StreetsAndAlleys):
    RowStack_Class = StackWrapper(RK_RowStack, base_rank=KING)
    Solver_Class = FreeCellSolverWrapper(sbb='rank', esf='kings')


# register the game
registerGame(GameInfo(146, StreetsAndAlleys, "Streets and Alleys",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(34, BeleagueredCastle, "Beleaguered Castle",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(145, Citadel, "Citadel",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(147, Fortress, "Fortress",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_SKILL))
registerGame(GameInfo(148, Chessboard, "Chessboard",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
                      GI.SL_SKILL))
registerGame(GameInfo(300, Stronghold, "Stronghold",
                      GI.GT_BELEAGUERED_CASTLE | GI.GT_OPEN, 1, 0,
Exemplo n.º 41
0
        return self._shuffleHookMoveToTop(cards, lambda c:
                                          (c.rank == ACE, c.suit))

    def startGame(self):
        self.s.talon.dealRow(rows=self.s.foundations, frames=0)
        self._startDealNumRows(4)
        self.s.talon.dealRowAvail()
        self.s.talon.dealRowAvail()


# register the game
registerGame(
    GameInfo(257,
             Numerica,
             "Numerica",
             GI.GT_NUMERICA | GI.GT_CONTRIB,
             1,
             0,
             GI.SL_BALANCED,
             altnames=("Sir Tommy", )))
registerGame(
    GameInfo(171, LadyBetty, "Lady Betty", GI.GT_NUMERICA, 1, 0,
             GI.SL_BALANCED))
registerGame(GameInfo(355, Frog, "Frog", GI.GT_NUMERICA, 2, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(356,
             Fly,
             "Fly",
             GI.GT_NUMERICA,
             2,
             0,
Exemplo n.º 42
0
    def fillStack(self, stack):
        if stack in self.s.rows and not stack.cards:
            old_state = self.enterState(self.S_FILL)
            if not self.s.waste.cards:
                self.s.talon.dealCards()
            if self.s.waste.cards:
                self.s.waste.moveMove(1, stack)
            self.leaveState(old_state)

    shallHighlightMatch = Game._shallHighlightMatch_RKW



# register the game
registerGame(GameInfo(330, Sultan, "Sultan",
                      GI.GT_2DECK_TYPE, 2, 2, GI.SL_MOSTLY_LUCK,
                      altnames=("Sultan of Turkey",) ))
registerGame(GameInfo(331, SultanPlus, "Sultan +",
                      GI.GT_2DECK_TYPE, 2, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(354, Boudoir, "Boudoir",
                      GI.GT_2DECK_TYPE, 2, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(410, CaptiveQueens, "Captive Queens",
                      GI.GT_1DECK_TYPE, 1, 2, GI.SL_MOSTLY_LUCK,
                      altnames=("Quadrille",) ))
registerGame(GameInfo(418, Contradance, "Contradance",
                      GI.GT_2DECK_TYPE, 2, 1, GI.SL_LUCK,
                      altnames=("Cotillion",) ))
registerGame(GameInfo(419, IdleAces, "Idle Aces",
                      GI.GT_2DECK_TYPE, 2, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(423, LadyOfTheManor, "Lady of the Manor",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_MOSTLY_LUCK,
Exemplo n.º 43
0
        for i in range(2):
            self.s.talon.dealRow(rows=self.s.reserves, frames=0)
        self.startDealSample()
        self.s.talon.dealRow(rows=self.s.reserves)
        self.s.talon.dealRow()

    def fillStack(self, stack):
        if stack in self.s.rows and not stack.cards and self.s.talon.cards:
            old_state = self.enterState(self.S_FILL)
            self.s.talon.flipMove()
            self.s.talon.moveMove(1, stack)
            self.leaveState(old_state)


# register the game
registerGame(GameInfo(38, Pyramid, "Pyramid",
                      GI.GT_PAIRING_TYPE, 1, 2, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(193, RelaxedPyramid, "Relaxed Pyramid",
                      GI.GT_PAIRING_TYPE | GI.GT_RELAXED, 1, 2,
                      GI.SL_MOSTLY_LUCK,
                      altnames=(" Pyramid's Stones",)))
# registerGame(GameInfo(44, Thirteen, "Thirteen",
#                       GI.GT_PAIRING_TYPE, 1, 0))
registerGame(GameInfo(592, Giza, "Giza",
                      GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(593, Thirteens, "Thirteens",
                      GI.GT_PAIRING_TYPE, 1, 0, GI.SL_LUCK))
registerGame(GameInfo(594, Elevens, "Elevens",
                      GI.GT_PAIRING_TYPE, 1, 0, GI.SL_LUCK))
registerGame(GameInfo(595, ElevensToo, "Elevens Too",
                      GI.GT_PAIRING_TYPE, 1, 0, GI.SL_LUCK))
registerGame(GameInfo(596, SuitElevens, "Suit Elevens",
Exemplo n.º 44
0
    shallHighlightMatch = Game._shallHighlightMatch_AC


class PairFcFreeCell(FreeCell):
    def createGame(self):
        FreeCell.createGame(self, reserves=2)


class ZeroFcFreeCell(FreeCell):
    def createGame(self):
        FreeCell.createGame(self, reserves=0)


# register the game
registerGame(GameInfo(5, RelaxedFreeCell, "Relaxed FreeCell",
                      GI.GT_FREECELL | GI.GT_RELAXED | GI.GT_OPEN, 1, 0,
                      GI.SL_SKILL))
registerGame(GameInfo(8, FreeCell, "FreeCell",
                      GI.GT_FREECELL | GI.GT_OPEN, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(1901, ZeroFcFreeCell, "FreeCell with Zero Reserves",
                      GI.GT_FREECELL | GI.GT_OPEN, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(1900, PairFcFreeCell, "FreeCell with Two Reserves",
                      GI.GT_FREECELL | GI.GT_OPEN, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(46, ForeCell, "ForeCell",
                      GI.GT_FREECELL | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(77, Stalactites, "Stalactites",
                      GI.GT_FREECELL | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Grampus", "Old Mole")))
registerGame(GameInfo(264, DoubleFreecell, "Double FreeCell",
                      GI.GT_FREECELL | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(265, TripleFreecell, "Triple FreeCell",
Exemplo n.º 45
0

class PokerShuffle(PokerSquare):
    Talon_Class = InitialDealTalonStack
    RowStack_Class = StackWrapper(PokerShuffle_RowStack, max_accept=1, max_cards=2)

    WIN_SCORE = 200

    def createGame(self):
        l = PokerSquare.createGame(self)
        if self.s.talon.texts.ncards:
            self.s.talon.texts.ncards.text_format="%D"

    def startGame(self):
        self.moveMove(27, self.s.talon, self.s.internals[0], frames=0)
        self.startDealSample()
        self.s.talon.dealRow()

    def checkForWin(self):
        return 0


# register the game
registerGame(GameInfo(139, PokerSquare, "Poker Square",
                      GI.GT_POKER_TYPE | GI.GT_SCORE, 1, 0, GI.SL_MOSTLY_SKILL,
                      si={"ncards": 25}))
registerGame(GameInfo(140, PokerShuffle, "Poker Shuffle",
                      GI.GT_POKER_TYPE | GI.GT_SCORE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL,
                      si={"ncards": 25}))

Exemplo n.º 46
0
        l.createText(s.talon, 'n')
        x -= l.XS
        s.waste = WasteStack(x, y, self)
        l.createText(s.waste, 'n')

        # define stack-groups
        l.defaultStackGroups()

    def startGame(self):
        self._startDealNumRowsAndDealRowAndCards(4)

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game
registerGame(GameInfo(290, Bisley, "Bisley",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(372, DoubleBisley, "Double Bisley",
                      GI.GT_2DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL,
                      2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(373, Gloria, "Gloria",
                      GI.GT_2DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL,
                      2, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(374, Realm, "Realm",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL,
                      1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(375, Mancunian, "Mancunian",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL,
                      1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(686, HospitalPatience, "Hospital Patience",
                      GI.GT_1DECK_TYPE, 1, -1, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(692, BoardPatience, "Board Patience",
Exemplo n.º 47
0
class Manx(TabbyCat):
    ReserveStack_Class = ReserveStack


class MaineCoon(TabbyCat):
    def createGame(self):
        TabbyCat.createGame(self, playcards=26)


# register the game
registerGame(
    GameInfo(
        903,
        AcesUp,
        "Aces Up",  # was: 52
        GI.GT_1DECK_TYPE,
        1,
        0,
        GI.SL_LUCK,
        altnames=("Aces High", "Drivel")))
registerGame(
    GameInfo(206, Fortunes, "Fortunes", GI.GT_1DECK_TYPE, 1, 0, GI.SL_LUCK))
registerGame(
    GameInfo(213, RussianAces, "Russian Aces", GI.GT_1DECK_TYPE, 1, 0,
             GI.SL_LUCK))
registerGame(
    GameInfo(130,
             PerpetualMotion,
             "Perpetual Motion",
             GI.GT_1DECK_TYPE,
             1,
Exemplo n.º 48
0
        self.rank = game.loadinfo.dval.get('Rank')
        self.deadDeals = game.loadinfo.dval.get('DeadDeals')

    def _loadGameHook(self, p):
        self.loadinfo.addattr(dval=p.load())

    def _saveGameHook(self, p):
        dval = {'Rank': self.rank, 'DeadDeals': self.deadDeals}
        p.dump(dval)

    def setState(self, state):
        # restore saved vars (from undo/redo)
        self.rank = state[0]
        self.deadDeals = state[1]

    def getState(self):
        # save vars (for undo/redo)
        return [self.rank, self.deadDeals]


# register the game
registerGame(
    GameInfo(774,
             HitOrMiss,
             "Hit or Miss",
             GI.GT_1DECK_TYPE,
             1,
             VARIABLE_REDEALS,
             GI.SL_LUCK,
             altnames=("Roll Call", )))
Exemplo n.º 49
0
    shallHighlightMatch = Game._shallHighlightMatch_AC


class DoubleFootling(Footling):
    def createGame(self):
        Footling.createGame(self, rows=10, reserves=5, playcards=18)

    def startGame(self):
        self._startDealNumRows(9)
        self.s.talon.dealRow()
        self.s.talon.dealRowAvail()


# register the game
registerGame(GameInfo(41, PileOn, "PileOn",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL,
                      altnames=("Fifteen Puzzle",)))
registerGame(GameInfo(289, SmallPileOn, "Small PileOn",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
                      GI.SL_MOSTLY_SKILL,
                      ranks=(0, 5, 6, 7, 8, 9, 10, 11, 12),
                      rules_filename="pileon.html"))
registerGame(GameInfo(554, Foursome, "Foursome",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(555, Quartets, "Quartets",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
                      GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(703, FourByFour, "Four by Four",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(740, Footling, "Footling",
                      GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
Exemplo n.º 50
0
# ************************************************************************
# * Relaxed Accordion
# ************************************************************************


class RelaxedAccordion_RowStack(Accordion2_RowStack):
    acceptsCards = Accordion_RowStack.acceptsCards


class RelaxedAccordion(Accordion2):
    RowStack_Class = RelaxedAccordion_RowStack


registerGame(
    GameInfo(287, PushPin, "Push Pin", GI.GT_1DECK_TYPE, 1, 0,
             GI.SL_MOSTLY_LUCK))
registerGame(
    GameInfo(288, RoyalMarriage, "Royal Marriage", GI.GT_1DECK_TYPE, 1, 0,
             GI.SL_MOSTLY_LUCK))
## registerGame(GameInfo(303, Queens, "Queens",
##                       GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
registerGame(
    GameInfo(656, Accordion, "Bayan", GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(772,
             Accordion2,
             "Accordion",
             GI.GT_1DECK_TYPE,
             1,
             0,
Exemplo n.º 51
0
        # define stack-groups
        l.defaultStackGroups()

    #
    # game overrides
    #

    def isGameWon(self):
        return len(self.s.talon.cards) == 0 and len(self.s.waste.cards) == 0

    def getAutoStacks(self, event=None):
        return ((), (), ())

    def shallHighlightMatch(self, stack1, card1, stack2, card2):
        return card1.rank + card2.rank == 12


# ************************************************************************
# * Strict Eiffel Tower
# ************************************************************************

class StrictEiffelTower(EiffelTower):
    Waste_Class = StackWrapper(WasteStack, max_cards=2)


# register the game
registerGame(GameInfo(16, EiffelTower, "Eiffel Tower",
                      GI.GT_PAIRING_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
# registerGame(GameInfo(801, StrictEiffelTower, "Strict Eiffel Tower",
#                       GI.GT_PAIRING_TYPE, 2, 0))
Exemplo n.º 52
0
        self.loadinfo.addattr(peaks=[0]*3)
        self.loadinfo.peaks = p.load()

    def _saveGameHook(self, p):
        p.dump(self.game_score)
        p.dump(self.hand_score)
        p.dump(self.sequence)
        p.dump(self.peaks)


# ************************************************************************
# * Three Peaks Game Non-scoring
# ************************************************************************

class ThreePeaksNoScore(ThreePeaks):
    SCORING = 0

    def canUndo(self):
        return True



registerGame(GameInfo(22216, ThreePeaks, "Three Peaks",
                      GI.GT_PAIRING_TYPE | GI.GT_SCORE, 1, 0, GI.SL_BALANCED,
                      altnames=("Tri Peaks",)
                      ))
registerGame(GameInfo(22231, ThreePeaksNoScore, "Three Peaks Non-scoring",
                      GI.GT_PAIRING_TYPE, 1, 0, GI.SL_BALANCED))


Exemplo n.º 53
0
        self.fillStack()
        game.updateStackMove(game.s.talon, 1 | 16)  # for redo
        game.leaveState(old_state)

    clickHandler = ReserveStack.clickHandler


class Decade(PushPin):
    Hint_Class = Decade_Hint
    RowStack_Class = Decade_RowStack

    def isGameWon(self):
        return len(self.s.foundations[0].cards) == 52


registerGame(GameInfo(287, PushPin, "Push Pin",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(288, RoyalMarriage, "Royal Marriage",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
#  registerGame(GameInfo(303, Queens, "Queens",
#                        GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
registerGame(GameInfo(656, Accordion, "Bayan",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(772, Accordion2, "Accordion",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL,
                      altnames=('Idle Year', 'Methuselah', 'Tower of Babel')))
registerGame(GameInfo(773, RelaxedAccordion, "Relaxed Accordion",
                      GI.GT_1DECK_TYPE | GI.GT_RELAXED, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(811, AccordionsRevenge, "Accordion's Revenge",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL))
registerGame(GameInfo(816, Decade, "Decade",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_SKILL,
Exemplo n.º 54
0
        l.defaultStackGroups()

    #
    # game extras
    #

    def cardsMatch(self, card1, card2):
        return card1.rank == card2.rank


# register the game
registerGame(
    GameInfo(176,
             Memory24,
             "Memory 24",
             GI.GT_MEMORY | GI.GT_SCORE,
             2,
             0,
             GI.SL_SKILL,
             suits=(0, 2),
             ranks=(0, 8, 9, 10, 11, 12)))
registerGame(
    GameInfo(219,
             Memory30,
             "Memory 30",
             GI.GT_MEMORY | GI.GT_SCORE,
             2,
             0,
             GI.SL_SKILL,
             suits=(0, 2, 3),
             ranks=(0, 9, 10, 11, 12)))
registerGame(
Exemplo n.º 55
0
        self.startDealSample()
        self.s.talon.dealRow()
        self.s.talon.dealCards()

    def fillStack(self, stack):
        if stack in self.s.rows and not stack.cards:
            if self.s.reserves[0].cards:
                old_state = self.enterState(self.S_FILL)
                self.s.reserves[0].moveMove(1, stack)
                self.leaveState(old_state)

    shallHighlightMatch = Game._shallHighlightMatch_AC


# register the game
registerGame(GameInfo(105, Canfield, "Canfield",                # was: 262
                      GI.GT_CANFIELD | GI.GT_CONTRIB, 1, -1, GI.SL_BALANCED))
registerGame(GameInfo(101, SuperiorCanfield, "Superior Canfield",
                      GI.GT_CANFIELD, 1, -1, GI.SL_BALANCED))
registerGame(GameInfo(99, Rainfall, "Rainfall",
                      GI.GT_CANFIELD | GI.GT_ORIGINAL, 1, 2, GI.SL_BALANCED))
registerGame(GameInfo(108, Rainbow, "Rainbow",
                      GI.GT_CANFIELD, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(100, Storehouse, "Storehouse",
                      GI.GT_CANFIELD, 1, 2, GI.SL_BALANCED,
                      altnames=("Provisions", "Straight Up", "Thirteen Up")))
registerGame(GameInfo(43, Chameleon, "Chameleon",
                      GI.GT_CANFIELD, 1, 0, GI.SL_BALANCED,
                      altnames="Kansas"))
registerGame(GameInfo(106, DoubleCanfield, "Double Canfield",   # was: 22
                      GI.GT_CANFIELD, 2, -1, GI.SL_BALANCED))
registerGame(GameInfo(103, AmericanToad, "American Toad",
Exemplo n.º 56
0
        self.s.talon.dealRow(flip=False)
        self.flipMove(self.s.rows[-1])
        self.s.rows[-1]._fillStack()

    def isGameWon(self):
        for r in self.s.rows:
            if not r.cards[-1].face_up:
                return False
        return True

    def getHighlightPilesStacks(self):
        return ()

    def getAutoStacks(self, event=None):
        return (), (), ()


# register the game
registerGame(GameInfo(261, GrandfathersClock, "Grandfather's Clock",
                      GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(682, Dial, "Dial",
                      GI.GT_1DECK_TYPE, 1, 1, GI.SL_LUCK))
registerGame(GameInfo(690, Hemispheres, "Hemispheres",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED,
                      altnames=("The Four Continents",)))
registerGame(GameInfo(697, BigBen, "Big Ben",
                      GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
registerGame(GameInfo(737, Clock, "Clock",
                      GI.GT_1DECK_TYPE, 1, 0, GI.SL_LUCK,
                      altnames=("Travellers",)))
Exemplo n.º 57
0
        for r in l.s.rows:
            s.rows.append(Yukon_AC_RowStack(r.x, r.y, self))
        l.defaultAll()

    def startGame(self):
        self.s.talon.dealRow(frames=0)
        self.s.talon.dealRow(frames=0, flip=0)
        self.startDealSample()
        self.s.talon.dealRow()

    shallHighlightMatch = Game._shallHighlightMatch_AC



# register the game
registerGame(GameInfo(19, Yukon, "Yukon",
                      GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(20, RussianSolitaire, "Russian Solitaire",
                      GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(27, Odessa, "Odessa",
                      GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(278, Grandfather, "Grandfather",
                      GI.GT_YUKON, 1, 2, GI.SL_BALANCED))
registerGame(GameInfo(186, Alaska, "Alaska",
                      GI.GT_YUKON, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(187, ChineseDiscipline, "Chinese Discipline",
                      GI.GT_YUKON | GI.GT_XORIGINAL, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(188, ChineseSolitaire, "Chinese Solitaire",
                      GI.GT_YUKON | GI.GT_XORIGINAL, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(189, Queenie, "Queenie",
                      GI.GT_YUKON | GI.GT_XORIGINAL, 1, 0, GI.SL_BALANCED))
registerGame(GameInfo(190, Rushdike, "Rushdike",
Exemplo n.º 58
0
        self.startDealSample()
        for i in range(3):
            rows = self.s.tableaux[i * 8 + 1:i * 8 + 8]
            self.s.talon.dealRow(rows=rows)
        self.s.talon.dealRow()

    def fillStack(self, stack):
        pass


# register the game
registerGame(
    GameInfo(7,
             PictureGallery,
             "Picture Gallery",
             GI.GT_2DECK_TYPE,
             2,
             0,
             GI.SL_BALANCED,
             altnames=("Die Bildgallerie", "Mod-3")))
registerGame(
    GameInfo(
        397,
        GreatWheel,
        "Great Wheel",
        GI.GT_2DECK_TYPE,
        2,
        0,
        GI.SL_BALANCED,
        ranks=range(12)  # without Kings
    ))
Exemplo n.º 59
0

# ************************************************************************
# * Relaxed Accordion
# ************************************************************************


class RelaxedAccordion_RowStack(Accordion2_RowStack):
    acceptsCards = Accordion_RowStack.acceptsCards


class RelaxedAccordion(Accordion2):
    RowStack_Class = RelaxedAccordion_RowStack


registerGame(GameInfo(287, PushPin, "Push Pin", GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(288, RoyalMarriage, "Royal Marriage", GI.GT_1DECK_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
## registerGame(GameInfo(303, Queens, "Queens",
##                       GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0))
registerGame(GameInfo(656, Accordion, "Bayan", GI.GT_1DECK_TYPE, 1, 0, GI.SL_BALANCED))
registerGame(
    GameInfo(
        772,
        Accordion2,
        "Accordion",
        GI.GT_1DECK_TYPE,
        1,
        0,
        GI.SL_BALANCED,
        altnames=("Idle Year", "Methuselah", "Tower of Babel"),
    )