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

+ 3 new games

* bugfixes


git-svn-id: file:///home/shlomif/Backup/svn-dumps/PySolFC/svnsync-repos/pysolfc/PySolFC/trunk@211 efabe8c0-fbe8-4139-b769-b5e6d273206e
This commit is contained in:
skomoroh 2007-09-13 21:20:38 +00:00
parent 273cce0a7d
commit de714447b6
8 changed files with 49 additions and 23 deletions

View file

@ -8,7 +8,7 @@ Move all cards to the foundations.
<h3>Quick Description</h3>
<p>
Like <a href="groundforadivorce.html">Ground for a Divorce</a>,
Like <a href="groundsforadivorce.html">Grounds for a Divorce</a>,
but with three decks and 13 playing piles.
<h3>Rules</h3>

View file

@ -1,4 +1,4 @@
<h1>Ground for a Divorce</h1>
<h1>Grounds for a Divorce</h1>
<p>
Spider type. 2 decks. No redeal.

View file

@ -360,7 +360,7 @@ class GI:
('fc-0.9.3', tuple(range(466, 661))),
('fc-0.9.4', tuple(range(661, 671))),
('fc-1.0', tuple(range(671, 711))),
('fc-1.1', tuple(range(711, 756))),
('fc-1.1', tuple(range(711, 759))),
)
# deprecated - the correct way is to or a GI.GT_XXX flag

View file

@ -209,8 +209,6 @@ class Shisen_RowStack(Mahjongg_RowStack):
#print res_path
return res_path
return a[x2][y2] < 4
def fillStack(self):
self.game.fillStack(self)
@ -353,7 +351,6 @@ class AbstractShisenGame(AbstractMahjonggGame):
self.cols[col].append(stack)
#from pprint import pprint
#pprint(self.cols)
self.cols_len = [rows]*cols
# create other stacks
y = l.YM + dyy
@ -454,13 +451,41 @@ class Shisen_24x12_NoGravity(AbstractShisenGame):
NCARDS = 288
GRAVITY = False
# /***********************************************************************
# // Not Shisen-Sho
# ************************************************************************/
class NotShisen_RowStack(Shisen_RowStack):
def acceptsCards(self, from_stack, cards):
if not self.game.cardsMatch(self.cards[0], cards[-1]):
return 0
if self.coln != from_stack.coln and self.rown != from_stack.rown:
return 0
return [(self.coln+1, self.rown+1),
(from_stack.coln+1, from_stack.rown+1)]
class NotShisen_14x6(AbstractShisenGame):
RowStack_Class = NotShisen_RowStack
L = (14, 6)
NCARDS = 84
class NotShisen_18x8(AbstractShisenGame):
RowStack_Class = NotShisen_RowStack
L = (18, 8)
class NotShisen_24x12(AbstractShisenGame):
RowStack_Class = NotShisen_RowStack
L = (24, 12)
NCARDS = 288
# /***********************************************************************
# // register a Shisen-Sho type game
# ************************************************************************/
def r(id, gameclass, short_name, name=None, decks=1, ranks=10, trumps=12):
if not name:
name = short_name
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,
@ -468,15 +493,19 @@ def r(id, gameclass, short_name, name=None, decks=1, ranks=10, trumps=12):
suits=range(3), ranks=range(ranks), trumps=range(trumps),
si={"decks": decks, "ncards": gameclass.NCARDS})
gi.ncards = gameclass.NCARDS
gi.rules_filename = "shisensho.html"
gi.rules_filename = rules_filename
registerGame(gi)
return gi
r(11001, Shisen_14x6, "Shisen-Sho 14x6")
r(11002, Shisen_18x8, "Shisen-Sho 18x8")
r(11003, Shisen_24x12, "Shisen-Sho 24x12")
r(11004, Shisen_14x6_NoGravity, "Shisen-Sho (No Gra) 14x6")
r(11005, Shisen_18x8_NoGravity, "Shisen-Sho (No Gra) 18x8")
r(11006, Shisen_24x12_NoGravity, "Shisen-Sho (No Gra) 24x12")
r(11004, Shisen_14x6_NoGravity, "Shisen-Sho (No Gravity) 14x6")
r(11005, Shisen_18x8_NoGravity, "Shisen-Sho (No Gravity) 18x8")
r(11006, Shisen_24x12_NoGravity, "Shisen-Sho (No Gravity) 24x12")
r(11011, NotShisen_14x6, "Not Shisen-Sho 14x6", "notshisensho.html")
r(11012, NotShisen_18x8, "Not Shisen-Sho 18x8", "notshisensho.html")
r(11013, NotShisen_24x12, "Not Shisen-Sho 24x12", "notshisensho.html")
del r

View file

@ -225,8 +225,7 @@ class Struct:
self.__dict__[key] = None
def copy(self):
c = Struct()
c.__class__ = self.__class__
c = self.__class__()
c.__dict__.update(self.__dict__)
return c

View file

@ -73,8 +73,7 @@ class SysRandom(random.Random):
self.setstate(self.initial_state)
def copy(self):
random = PysolRandom(0L)
random.__class__ = self.__class__
random = self.__class__(0L)
random.__dict__.update(self.__dict__)
return random
@ -135,8 +134,7 @@ class MFXRandom:
self.seed = state
def copy(self):
random = PysolRandom(0L)
random.__class__ = self.__class__
random = self.__class__(0L)
random.__dict__.update(self.__dict__)
return random

View file

@ -28,8 +28,8 @@ PACKAGE = 'PySolFC'
TITLE = 'PySol'
PACKAGE_URL = 'http://pysolfc.sourceforge.net/'
VERSION = '1.1'
VERSION_TUPLE = (1, 1)
VERSION = '1.1.1'
VERSION_TUPLE = (1, 1, 1)
# Tk windowing system (auto set up in init.py)
WIN_SYSTEM = 'x11' # win32, x11, aqua, classic

View file

@ -38,7 +38,7 @@ class WizSetting:
self.values_map = values_map
self.default = default
##self.values_dict = dict(self.values_map)
self.translation_map = {}
self.translation_map = {} # for backward translation
if widget == 'menu':
self.values = []
for k, v in self.values_map:
@ -216,7 +216,7 @@ RowsBaseCard = WizSetting(
values_map = ((n_('Ace'), ACE),
(n_('King'), KING),
(n_('Any'), ANY_RANK),
(n_('None'), NO_RANK),
(n_('None'), NO_RANK),
),
default = n_('Any'),
label = _('Base card:'),