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

flake8 - games/m*

This commit is contained in:
Shlomi Fish 2017-04-18 00:54:51 +03:00
parent d572d2921d
commit 231d370000
4 changed files with 140 additions and 83 deletions

View file

@ -24,23 +24,28 @@
__all__ = []
# imports
import sys
# PySol imports
from pysollib.mygettext import _, n_
from pysollib.mygettext import _
from pysollib.gamedb import registerGame, GameInfo, GI
from pysollib.util import *
from pysollib.stack import *
from pysollib.game import Game
from pysollib.layout import Layout
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
from pysollib.hint import CautiousDefaultHint
from pysollib.pysoltk import MfxCanvasText
from pysollib.util import KING, QUEEN, VARIABLE_REDEALS
from pysollib.stack import \
Stack, \
WasteStack, \
WasteTalonStack, \
SS_RowStack
# ************************************************************************
# * Talon
# ************************************************************************
class Matriarchy_Waste(WasteStack):
def updateText(self):
WasteStack.updateText(self)
@ -57,8 +62,8 @@ class Matriarchy_Talon(WasteTalonStack):
self.max_rounds = 11
rows = self.game.s.rows
for i in (0, 2, 4, 6):
l1 = len(rows[i+0].cards) + len(rows[i+8].cards)
l2 = len(rows[i+1].cards) + len(rows[i+9].cards)
l1 = len(rows[i+0].cards) + len(rows[i+8].cards)
l2 = len(rows[i+1].cards) + len(rows[i+9].cards)
assert l1 + l2 <= 26
if l1 + l2 == 26:
self.max_rounds = self.max_rounds + 2
@ -121,7 +126,7 @@ class Matriarchy_Talon(WasteTalonStack):
if self.game.preview > 1:
return
WasteTalonStack.updateText(self, update_rounds=0)
## t = "Round %d" % self.round
# t = "Round %d" % self.round
t = _("Round %d/%d") % (self.round, self.max_rounds)
self.texts.rounds.config(text=t)
t = _("Deal %d") % self.DEAL[self.round-1]
@ -172,7 +177,7 @@ class Matriarchy(Game):
self.setSize(10*l.XS+l.XM, h + l.YM + h)
# create stacks
##center, c1, c2 = self.height / 2, h, self.height - h
# center, c1, c2 = self.height / 2, h, self.height - h
center = self.height / 2
c1, c2 = center-l.TEXT_HEIGHT/2, center+l.TEXT_HEIGHT/2
x, y = l.XM, c1 - l.CH
@ -191,9 +196,10 @@ class Matriarchy(Game):
s.talon = Matriarchy_Talon(x, y, self, max_rounds=VARIABLE_REDEALS)
l.createText(s.talon, "n")
l.createRoundText(s.talon, 'ss')
s.talon.texts.misc = MfxCanvasText(self.canvas,
tx, center, anchor="center",
font=self.app.getFont("canvas_large"))
s.talon.texts.misc = MfxCanvasText(
self.canvas,
tx, center, anchor="center",
font=self.app.getFont("canvas_large"))
# define stack-groups
l.defaultStackGroups()
@ -204,7 +210,8 @@ class Matriarchy(Game):
def _shuffleHook(self, cards):
# move Queens to top of the Talon (i.e. first cards to be dealt)
return self._shuffleHookMoveToTop(cards, lambda c: (c.rank == 11, c.suit), 8)
return self._shuffleHookMoveToTop(
cards, lambda c: (c.rank == 11, c.suit), 8)
def startGame(self):
self.startDealSample()
@ -218,10 +225,10 @@ class Matriarchy(Game):
if card1.rank + card2.rank == QUEEN + KING:
return False
return (card1.suit == card2.suit and
((card1.rank + 1) % 13 == card2.rank or (card2.rank + 1) % 13 == card1.rank))
((card1.rank + 1) % 13 == card2.rank or
(card2.rank + 1) % 13 == card1.rank))
# register the game
registerGame(GameInfo(17, Matriarchy, "Matriarchy",
GI.GT_2DECK_TYPE, 2, VARIABLE_REDEALS, GI.SL_BALANCED))

View file

@ -24,24 +24,34 @@
__all__ = []
# imports
import sys
# PySol imports
from pysollib.gamedb import registerGame, GameInfo, GI
from pysollib.util import *
from pysollib.stack import *
from pysollib.game import Game
from pysollib.layout import Layout
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
from pysollib.hint import DefaultHint
from pysollib.util import ACE, NO_SUIT
from pysollib.stack import \
BasicRowStack, \
InitialDealTalonStack, \
InvisibleStack, \
Stack, \
StackWrapper, \
TalonStack, \
WasteStack, \
WasteTalonStack
# ************************************************************************
# *
# ************************************************************************
class Montana_Hint(DefaultHint):
def computeHints(self):
game = self.game
RLEN, RSTEP, RBASE = game.RLEN, game.RSTEP, game.RBASE
RSTEP, RBASE = game.RSTEP, game.RBASE
freerows = [s for s in game.s.rows if not s.cards]
# for each stack
for r in game.s.rows:
@ -54,7 +64,8 @@ class Montana_Hint(DefaultHint):
else:
left = None
if c.rank == RBASE:
# do not move the leftmost card of a row if the rank is correct
# do not move the leftmost card of a row if the
# rank is correct
continue
for t in freerows:
if self.shallMovePile(r, t, pile, rpile):
@ -82,7 +93,7 @@ class Montana_Talon(TalonStack):
# move cards to the Talon, shuffle and redeal
game = self.game
decks = game.gameinfo.decks
RLEN, RSTEP, RBASE = game.RLEN, game.RSTEP, game.RBASE
RSTEP, RBASE = game.RSTEP, game.RBASE
num_cards = 0
assert len(self.cards) == 0
rows = game.s.rows
@ -100,7 +111,7 @@ class Montana_Talon(TalonStack):
r = rows[i + j]
if in_sequence:
if (not r.cards or
not self._inSequence(r.cards[-1], suit, RBASE+j)):
not self._inSequence(r.cards[-1], suit, RBASE+j)):
in_sequence = 0
if not in_sequence:
stacks.append(r)
@ -121,7 +132,7 @@ class Montana_Talon(TalonStack):
game.nextRoundMove(self)
spaces = self.getRedealSpaces(stacks, gaps)
for r in stacks:
if not r in spaces:
if r not in spaces:
self.game.moveMove(1, self, r, frames=4)
# done
assert len(self.cards) == 0
@ -141,7 +152,8 @@ class Montana_RowStack(BasicRowStack):
if self.id % self.game.RSTEP == 0:
return cards[0].rank == self.game.RBASE
left = self.game.s.rows[self.id - 1]
return left.cards and left.cards[-1].suit == cards[0].suit and left.cards[-1].rank + 1 == cards[0].rank
return left.cards and left.cards[-1].suit == cards[0].suit \
and left.cards[-1].rank + 1 == cards[0].rank
def clickHandler(self, event):
if not self.cards:
@ -196,7 +208,6 @@ class Montana(Game):
# define stack-groups
l.defaultStackGroups()
#
# game overrides
#
@ -221,7 +232,8 @@ class Montana(Game):
suit = rows[i].cards[-1].suit
for j in range(self.RSTEP - 1):
r = rows[i + j]
if not r.cards or r.cards[-1].rank != self.RBASE + j or r.cards[-1].suit != suit:
if not r.cards or r.cards[-1].rank != self.RBASE + j \
or r.cards[-1].suit != suit:
return False
return True
@ -235,7 +247,8 @@ class Montana(Game):
def getQuickPlayScore(self, ncards, from_stack, to_stack):
if from_stack.cards:
if from_stack.id % self.RSTEP == 0 and from_stack.cards[-1].rank == self.RBASE:
if from_stack.id % self.RSTEP == 0 and \
from_stack.cards[-1].rank == self.RBASE:
# do not move the leftmost card of a row if the rank is correct
return -1
return 1
@ -252,10 +265,11 @@ class Spaces_Talon(Montana_Talon):
spaces = []
while len(spaces) != 4:
r = self.game.random.choice(stacks)
if not r in spaces:
if r not in spaces:
spaces.append(r)
return spaces
class Spaces(Montana):
Talon_Class = StackWrapper(Spaces_Talon, max_rounds=3)
@ -270,13 +284,14 @@ class BlueMoon(Montana):
def startGame(self):
frames = 0
for i in range(self.RLEN):
if i == self.RLEN-self.RSTEP: # last row
if i == self.RLEN-self.RSTEP: # last row
self.startDealSample()
frames = -1
if i % self.RSTEP == 0: # left column
continue
self.s.talon.dealRow(rows=(self.s.rows[i],), frames=frames)
ace_rows = [r for r in self.s.rows if r.cards and r.cards[-1].rank == ACE]
ace_rows = [r for r in self.s.rows
if r.cards and r.cards[-1].rank == ACE]
j = 0
for r in ace_rows:
self.moveMove(1, r, self.s.rows[j])
@ -290,7 +305,8 @@ class BlueMoon(Montana):
class RedMoon(BlueMoon):
def _shuffleHook(self, cards):
# move Aces to top of the Talon (i.e. first cards to be dealt)
return self._shuffleHookMoveToTop(cards, lambda c: (c.rank == 0, c.suit))
return self._shuffleHookMoveToTop(
cards, lambda c: (c.rank == 0, c.suit))
def startGame(self):
decks = self.gameinfo.decks
@ -312,7 +328,8 @@ class RedMoon(BlueMoon):
class Galary_Hint(Montana_Hint):
def shallMovePile(self, from_stack, to_stack, pile, rpile):
if from_stack is to_stack or not to_stack.acceptsCards(from_stack, pile):
if from_stack is to_stack or \
not to_stack.acceptsCards(from_stack, pile):
return False
# now check for loops
rr = self.ClonedStack(from_stack, stackcards=rpile)
@ -332,12 +349,12 @@ class Galary_RowStack(Montana_RowStack):
r = self.game.s.rows
left = r[self.id - 1]
if left.cards and left.cards[-1].suit == cards[0].suit \
and left.cards[-1].rank + 1 == cards[0].rank:
and left.cards[-1].rank + 1 == cards[0].rank:
return True
if self.id < len(r)-1:
right = r[self.id + 1]
if right.cards and right.cards[-1].suit == cards[0].suit \
and right.cards[-1].rank - 1 == cards[0].rank:
and right.cards[-1].rank - 1 == cards[0].rank:
return True
return False
@ -369,6 +386,7 @@ class Jungle_RowStack(Montana_RowStack):
left = self.game.s.rows[self.id - 1]
return left.cards and left.cards[-1].rank + 1 == cards[0].rank
class Jungle(BlueMoon):
Talon_Class = StackWrapper(Montana_Talon, max_rounds=2)
RowStack_Class = Jungle_RowStack
@ -386,7 +404,8 @@ class SpacesAndAces_RowStack(Montana_RowStack):
if self.id % self.game.RSTEP == 0:
return cards[0].rank == self.game.RBASE
left = self.game.s.rows[self.id - 1]
return left.cards and left.cards[-1].suit == cards[0].suit and left.cards[-1].rank < cards[0].rank
return left.cards and left.cards[-1].suit == cards[0].suit \
and left.cards[-1].rank < cards[0].rank
class SpacesAndAces(BlueMoon):
@ -400,7 +419,7 @@ class SpacesAndAces(BlueMoon):
def startGame(self):
frames = 0
for i in range(self.RLEN):
if i == self.RLEN-self.RSTEP: # last row
if i == self.RLEN-self.RSTEP: # last row
self.startDealSample()
frames = -1
if i % self.RSTEP == 0: # left column
@ -411,6 +430,7 @@ class SpacesAndAces(BlueMoon):
# * Paganini
# ************************************************************************
class Paganini_Talon(Montana_Talon):
def _inSequence(self, card, suit, rank):
card_rank = card.rank
@ -418,6 +438,7 @@ class Paganini_Talon(Montana_Talon):
card_rank -= 4
return card.suit == suit and card_rank == rank
class Paganini_RowStack(Montana_RowStack):
def acceptsCards(self, from_stack, cards):
if not BasicRowStack.acceptsCards(self, from_stack, cards):
@ -433,6 +454,7 @@ class Paganini_RowStack(Montana_RowStack):
return cards[0].rank == 5
return left.cards[-1].rank+1 == cards[0].rank
class Paganini(BlueMoon):
RLEN, RSTEP, RBASE = 40, 10, 0
@ -464,7 +486,7 @@ class Paganini(BlueMoon):
class Spoilt_RowStack(BasicRowStack):
def acceptsCards(self, from_stack, cards):
#if not BasicRowStack.acceptsCards(self, from_stack, cards):
# if not BasicRowStack.acceptsCards(self, from_stack, cards):
# return False
card = cards[0]
@ -582,24 +604,28 @@ class DoubleMontana(Montana):
def startGame(self):
frames = 0
for i in range(self.RLEN):
if i == self.RLEN-self.RSTEP: # last row
if i == self.RLEN-self.RSTEP: # last row
self.startDealSample()
frames = -1
if i % self.RSTEP == 0: # left column
continue
self.s.talon.dealRow(rows=(self.s.rows[i],), frames=frames)
class DoubleBlueMoon(DoubleMontana, BlueMoon):
Talon_Class = StackWrapper(Montana_Talon, max_rounds=3)
RLEN, RSTEP, RBASE = 112, 14, 0
def createGame(self):
BlueMoon.createGame(self, round_text=True)
startGame = BlueMoon.startGame
class DoubleRedMoon(DoubleMontana, RedMoon):
Talon_Class = StackWrapper(Montana_Talon, max_rounds=3)
RLEN, RROWS = 112, 8
_shuffleHook = RedMoon._shuffleHook
def createGame(self):
RedMoon.createGame(self, round_text=True)
startGame = RedMoon.startGame
@ -614,13 +640,15 @@ registerGame(GameInfo(116, Spaces, "Spaces",
si={"ncards": 48}))
registerGame(GameInfo(63, BlueMoon, "Blue Moon",
GI.GT_MONTANA | GI.GT_OPEN, 1, 2, GI.SL_MOSTLY_SKILL,
altnames=("Rangoon",) ))
altnames=("Rangoon",)))
registerGame(GameInfo(117, RedMoon, "Red Moon",
GI.GT_MONTANA | GI.GT_OPEN, 1, 2, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(275, Galary, "Galary",
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2, GI.SL_MOSTLY_SKILL))
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2,
GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(276, Moonlight, "Moonlight",
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2, GI.SL_MOSTLY_SKILL,
GI.GT_MONTANA | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 2,
GI.SL_MOSTLY_SKILL,
si={"ncards": 48}))
registerGame(GameInfo(380, Jungle, "Jungle",
GI.GT_MONTANA | GI.GT_OPEN, 1, 1, GI.SL_MOSTLY_SKILL))
@ -629,7 +657,7 @@ registerGame(GameInfo(381, SpacesAndAces, "Spaces and Aces",
registerGame(GameInfo(706, Paganini, "Paganini",
GI.GT_MONTANA | GI.GT_OPEN, 1, 1, GI.SL_MOSTLY_SKILL,
ranks=(0, 5, 6, 7, 8, 9, 10, 11, 12),
altnames=('Long Trip',) ))
altnames=('Long Trip',)))
registerGame(GameInfo(736, Spoilt, "Spoilt",
GI.GT_MONTANA, 1, 0, GI.SL_MOSTLY_LUCK,
ranks=(0, 6, 7, 8, 9, 10, 11, 12),
@ -640,5 +668,3 @@ registerGame(GameInfo(770, DoubleBlueMoon, "Double Blue Moon",
GI.GT_MONTANA | GI.GT_OPEN, 2, 2, GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(771, DoubleRedMoon, "Double Red Moon",
GI.GT_MONTANA | GI.GT_OPEN, 2, 2, GI.SL_MOSTLY_SKILL))

View file

@ -24,20 +24,31 @@
__all__ = []
# imports
import sys
# PySol imports
from pysollib.gamedb import registerGame, GameInfo, GI
from pysollib.util import *
from pysollib.stack import *
from pysollib.game import Game
from pysollib.layout import Layout
from pysollib.hint import AbstractHint, DefaultHint, CautiousDefaultHint
from pysollib.hint import DefaultHint
from pysollib.util import ANY_RANK, ANY_SUIT, KING, NO_RANK, UNLIMITED_REDEALS
from pysollib.stack import \
AbstractFoundationStack, \
BasicRowStack, \
DealRowRedealTalonStack, \
InitialDealTalonStack, \
OpenStack, \
ReserveStack, \
StackWrapper, \
TalonStack, \
SS_FoundationStack
# ************************************************************************
# *
# ************************************************************************
class MonteCarlo_Hint(DefaultHint):
# FIXME: demo is not too clever in this game
pass
@ -59,9 +70,9 @@ class MonteCarlo_Talon(TalonStack):
return free and len(self.cards)
def dealCards(self, sound=False):
self.game.updateStackMove(self.game.s.talon, 2|16) # for undo
self.game.updateStackMove(self.game.s.talon, 2 | 16) # for undo
n = self.game.fillEmptyStacks()
self.game.updateStackMove(self.game.s.talon, 1|16) # for redo
self.game.updateStackMove(self.game.s.talon, 1 | 16) # for redo
return n
@ -80,13 +91,14 @@ class MonteCarlo_RowStack(BasicRowStack):
if to_stack.cards:
self._dropPairMove(ncards, to_stack, frames=-1, shadow=shadow)
else:
BasicRowStack.moveMove(self, ncards, to_stack, frames=frames, shadow=shadow)
BasicRowStack.moveMove(
self, ncards, to_stack, frames=frames, shadow=shadow)
def _dropPairMove(self, n, other_stack, frames=-1, shadow=-1):
game = self.game
old_state = game.enterState(game.S_FILL)
f = game.s.foundations[0]
game.updateStackMove(game.s.talon, 2|16) # for undo
game.updateStackMove(game.s.talon, 2 | 16) # for undo
if not game.demo:
game.playSample("droppair", priority=200)
game.moveMove(n, self, f, frames=frames, shadow=shadow)
@ -95,13 +107,14 @@ class MonteCarlo_RowStack(BasicRowStack):
other_stack.fillStack()
if self.game.FILL_STACKS_AFTER_DROP:
game.fillEmptyStacks()
game.updateStackMove(game.s.talon, 1|16) # for redo
game.updateStackMove(game.s.talon, 1 | 16) # for redo
game.leaveState(old_state)
class MonteCarlo(Game):
Talon_Class = MonteCarlo_Talon
Foundation_Class = StackWrapper(AbstractFoundationStack, max_accept=0)
Foundation_Class = StackWrapper(
AbstractFoundationStack, max_accept=0)
RowStack_Class = MonteCarlo_RowStack
Hint_Class = MonteCarlo_Hint
@ -151,7 +164,6 @@ class MonteCarlo(Game):
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank == card2.rank
#
# game extras
#
@ -328,9 +340,11 @@ class Neighbour_RowStack(MonteCarlo_RowStack):
assert ncards == 1
if self.cards[-1].rank == KING:
assert to_stack in self.game.s.foundations
BasicRowStack.moveMove(self, ncards, to_stack, frames=frames, shadow=shadow)
BasicRowStack.moveMove(
self, ncards, to_stack, frames=frames, shadow=shadow)
else:
MonteCarlo_RowStack.moveMove(self, ncards, to_stack, frames=frames, shadow=shadow)
MonteCarlo_RowStack.moveMove(
self, ncards, to_stack, frames=frames, shadow=shadow)
def _dropKingClickHandler(self, event):
if not self.cards:
@ -400,7 +414,7 @@ class Fourteen(Game):
dir=0, base_rank=NO_RANK))
x, y = l.XM + 6*l.XS, l.YM
s.foundations.append(self.Foundation_Class(x, y, self, suit=ANY_SUIT,
max_move=0, max_cards=52, base_rank=ANY_RANK))
max_move=0, max_cards=52, base_rank=ANY_RANK))
l.createText(s.foundations[0], "s")
x, y = self.width - l.XS, self.height - l.YS
s.talon = InitialDealTalonStack(x, y, self)
@ -470,7 +484,7 @@ class Nestor(Game):
x += l.XS
x, y = self.width-l.XS, self.height-l.YS
s.foundations.append(self.Foundation_Class(x, y, self, suit=ANY_SUIT,
max_move=0, max_cards=52, base_rank=ANY_RANK))
max_move=0, max_cards=52, base_rank=ANY_RANK))
l.createText(s.foundations[0], "n")
x, y = l.XM, self.height - l.YS
s.talon = InitialDealTalonStack(x, y, self)
@ -492,7 +506,7 @@ class Nestor(Game):
def _shuffleHook(self, cards):
# no row will have two cards of the same rank
for i in range(8):
for t in range(1000): # just in case
for t in range(1000): # just in case
j = self._checkRow(cards[i*6:(i+1)*6])
if j < 0:
break
@ -552,7 +566,6 @@ class Vertical(Nestor):
# define stack-groups
l.defaultStackGroups()
def startGame(self):
self.s.talon.dealRow(frames=0)
for i in range(4):
@ -562,7 +575,6 @@ class Vertical(Nestor):
self.s.talon.dealRow(rows=[self.s.rows[3]])
# ************************************************************************
# * The Wish
# ************************************************************************
@ -590,8 +602,10 @@ class TheWish(Game):
s.talon = InitialDealTalonStack(x, y, self)
x, y = self.width - l.XS, self.height - l.YS
s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT,
max_move=0, max_cards=32, max_accept=0, base_rank=ANY_RANK))
s.foundations.append(
AbstractFoundationStack(
x, y, self, suit=ANY_SUIT,
max_move=0, max_cards=32, max_accept=0, base_rank=ANY_RANK))
l.createText(s.foundations[0], "n")
# define stack-groups
@ -617,9 +631,11 @@ class TheWish(Game):
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank == card2.rank
class TheWishOpen(TheWish):
def fillStack(self, stack):
pass
def startGame(self):
for i in range(3):
self.s.talon.dealRow(frames=0)
@ -630,11 +646,13 @@ class TheWishOpen(TheWish):
# * Der letzte Monarch (The last Monarch)
# ************************************************************************
class DerLetzteMonarch_Foundation(SS_FoundationStack):
def acceptsCards(self, from_stack, cards):
if cards is None:
# special hack for _getDropStack() below
return SS_FoundationStack.acceptsCards(self, from_stack, from_stack.cards)
return SS_FoundationStack.acceptsCards(
self, from_stack, from_stack.cards)
#
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
@ -714,14 +732,18 @@ class DerLetzteMonarch(Game):
for i in range(4):
for j in range(13):
x, y, = dx + l.XM + j*l.XS, l.YM + (i+1)*l.YS
s.rows.append(DerLetzteMonarch_RowStack(x, y, self, max_accept=1, max_cards=2))
s.rows.append(
DerLetzteMonarch_RowStack(
x, y, self, max_accept=1, max_cards=2))
for i in range(4):
x, y, = l.XM + (i+2)*l.XS, l.YM
s.reserves.append(DerLetzteMonarch_ReserveStack(x, y, self, max_accept=0))
s.reserves.append(
DerLetzteMonarch_ReserveStack(
x, y, self, max_accept=0))
for i in range(4*decks):
x, y, = l.XM + (i+7)*l.XS, l.YM
s.foundations.append(DerLetzteMonarch_Foundation(x, y, self,
suit=i%4, max_move=0))
suit=i % 4, max_move=0))
s.talon = self.Talon_Class(l.XM, l.YM, self)
if texts:
l.createText(s.talon, 'ne')
@ -753,7 +775,6 @@ class DerLetzteMonarch(Game):
def getDemoInfoText(self):
return "Der letzte\nMonarch"
#
# game extras
#
@ -791,7 +812,7 @@ class TheLastMonarchII(DerLetzteMonarch):
# ************************************************************************
class DoubletsII(Game):
FILL_STACKS_AFTER_DROP = False # for Nestor_RowStack
FILL_STACKS_AFTER_DROP = False # for Nestor_RowStack
def createGame(self):
l, s = Layout(self), self.s
@ -882,11 +903,10 @@ class RightAndLeft(Game):
self.s.talon.dealRow()
# register the game
registerGame(GameInfo(89, MonteCarlo, "Monte Carlo",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
altnames=("Quilt",) ))
altnames=("Quilt",)))
registerGame(GameInfo(216, MonteCarlo2Decks, "Monte Carlo (2 decks)",
GI.GT_PAIRING_TYPE, 2, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(212, Weddings, "Weddings",
@ -899,24 +919,28 @@ registerGame(GameInfo(91, SimplePairs, "Simple Pairs",
registerGame(GameInfo(92, Neighbour, "Neighbour",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(96, Fourteen, "Fourteen",
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_LUCK))
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0,
GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(235, Nestor, "Nestor",
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_LUCK))
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0,
GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(152, DerLetzteMonarch, "The Last Monarch",
GI.GT_1DECK_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL,
altnames=("Der letzte Monarch",) ))
altnames=("Der letzte Monarch",)))
registerGame(GameInfo(328, TheWish, "The Wish",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK,
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
registerGame(GameInfo(329, TheWishOpen, "The Wish (open)",
GI.GT_PAIRING_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0, GI.SL_MOSTLY_SKILL,
ranks=(0, 6, 7, 8, 9, 10, 11, 12) ))
GI.GT_PAIRING_TYPE | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
GI.SL_MOSTLY_SKILL,
ranks=(0, 6, 7, 8, 9, 10, 11, 12)))
registerGame(GameInfo(368, Vertical, "Vertical",
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_LUCK))
GI.GT_PAIRING_TYPE | GI.GT_OPEN, 1, 0,
GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(649, DoubletsII, "Doublets II",
GI.GT_PAIRING_TYPE, 1, 0, GI.SL_MOSTLY_LUCK))
registerGame(GameInfo(663, TheLastMonarchII, "The Last Monarch II",
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0, GI.SL_MOSTLY_SKILL))
GI.GT_2DECK_TYPE | GI.GT_ORIGINAL, 2, 0,
GI.SL_MOSTLY_SKILL))
registerGame(GameInfo(727, RightAndLeft, "Right and Left",
GI.GT_PAIRING_TYPE, 2, -1, GI.SL_LUCK))

View file

@ -10,7 +10,7 @@ use String::ShellQuote qw/ shell_quote /;
# my $cmd = shell_quote( 'flake8', '.' );
my $cmd = shell_quote( 'flake8',
grep { not($_ eq './pysollib/pysoltk.py' or $_ eq './pysollib/tile/ttk.py') } glob('./pysollib/*.py ./pysollib/[cmpuw]*/*.py ./pysollib/tile/*.py ./pysollib/ui/tktile/*.py ./pysollib/games/[a-ly-z]*.py') );
grep { not($_ eq './pysollib/pysoltk.py' or $_ eq './pysollib/tile/ttk.py') } glob('./pysollib/*.py ./pysollib/[cmpuw]*/*.py ./pysollib/tile/*.py ./pysollib/ui/tktile/*.py ./pysollib/games/[a-my-z]*.py') );
# TEST
eq_or_diff( scalar(`$cmd`), '', "flake8 is happy with the code." );