mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Half Klondike game.
This commit is contained in:
parent
331fbfc776
commit
3f1c66cd0c
4 changed files with 33 additions and 4 deletions
13
html-src/rules/halfklondike.html
Normal file
13
html-src/rules/halfklondike.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<h1>Half Klondike</h1>
|
||||||
|
<p>
|
||||||
|
Klondike type. 1 stripped deck. Unlimited redeals.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="klondike.html">Klondike</a>,
|
||||||
|
but with only the hearts and spades, and only
|
||||||
|
four tableau piles.
|
|
@ -543,7 +543,8 @@ class GI:
|
||||||
('fc-2.12', tuple(range(774, 811)) + (16681,) +
|
('fc-2.12', tuple(range(774, 811)) + (16681,) +
|
||||||
tuple(range(22217, 22219))),
|
tuple(range(22217, 22219))),
|
||||||
('fc-2.14', tuple(range(811, 827))),
|
('fc-2.14', tuple(range(811, 827))),
|
||||||
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407)))
|
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))),
|
||||||
|
('dev', tuple(range(855, 856)))
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -69,10 +69,10 @@ class Klondike(Game):
|
||||||
RowStack_Class = KingAC_RowStack
|
RowStack_Class = KingAC_RowStack
|
||||||
Hint_Class = KlondikeType_Hint
|
Hint_Class = KlondikeType_Hint
|
||||||
|
|
||||||
def createGame(self, max_rounds=-1, num_deal=1, **layout):
|
def createGame(self, max_rounds=-1, num_deal=1, rows=7, **layout):
|
||||||
# create layout
|
# create layout
|
||||||
lay, s = Layout(self), self.s
|
lay, s = Layout(self), self.s
|
||||||
kwdefault(layout, rows=7, waste=1, texts=1, playcards=16)
|
kwdefault(layout, rows=rows, waste=1, texts=1, playcards=16)
|
||||||
self.Layout_Method.__get__(lay, lay.__class__)(**layout)
|
self.Layout_Method.__get__(lay, lay.__class__)(**layout)
|
||||||
# self.__class__.Layout_Method(lay, **layout)
|
# self.__class__.Layout_Method(lay, **layout)
|
||||||
self.setSize(lay.size[0], lay.size[1])
|
self.setSize(lay.size[0], lay.size[1])
|
||||||
|
@ -149,6 +149,15 @@ class KlondikeByThrees(Klondike):
|
||||||
Klondike.createGame(self, num_deal=3)
|
Klondike.createGame(self, num_deal=3)
|
||||||
|
|
||||||
|
|
||||||
|
# ************************************************************************
|
||||||
|
# * Half Klondike
|
||||||
|
# ************************************************************************
|
||||||
|
|
||||||
|
class HalfKlondike(Klondike):
|
||||||
|
def createGame(self):
|
||||||
|
Klondike.createGame(self, rows=4)
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Trigon
|
# * Trigon
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -1611,3 +1620,6 @@ registerGame(GameInfo(849, RelaxedRaglan, "Relaxed Raglan",
|
||||||
GI.SL_MOSTLY_SKILL))
|
GI.SL_MOSTLY_SKILL))
|
||||||
registerGame(GameInfo(852, Guardian, "Guardian",
|
registerGame(GameInfo(852, Guardian, "Guardian",
|
||||||
GI.GT_KLONDIKE, 1, -1, GI.SL_BALANCED))
|
GI.GT_KLONDIKE, 1, -1, GI.SL_BALANCED))
|
||||||
|
registerGame(GameInfo(855, HalfKlondike, "Half Klondike",
|
||||||
|
GI.GT_KLONDIKE | GI.GT_STRIPPED, 1, -1, GI.SL_BALANCED,
|
||||||
|
suits=(1, 2)))
|
||||||
|
|
|
@ -606,9 +606,12 @@ class Layout:
|
||||||
# center the foundations
|
# center the foundations
|
||||||
x = XM + (maxrows - frows) * XS // 2
|
x = XM + (maxrows - frows) * XS // 2
|
||||||
for suit in range(suits // foundrows):
|
for suit in range(suits // foundrows):
|
||||||
|
cursuit = suit
|
||||||
|
if suit < len(self.game.gameinfo.suits):
|
||||||
|
cursuit = self.game.gameinfo.suits[suit]
|
||||||
for i in range(decks):
|
for i in range(decks):
|
||||||
self.s.foundations.append(
|
self.s.foundations.append(
|
||||||
S(x, y, suit=suit + (row * (suits // 2))))
|
S(x, y, suit=cursuit + (row * (suits // 2))))
|
||||||
x += XS
|
x += XS
|
||||||
y += YS
|
y += YS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue