mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Added a Backbone variant closer to AisleRiot rules.
This commit is contained in:
parent
2b4e228be9
commit
0ad6143cb8
6 changed files with 70 additions and 6 deletions
26
html-src/rules/backbone.html
Normal file
26
html-src/rules/backbone.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<h1>Backbone</h1>
|
||||||
|
<p>
|
||||||
|
Napoleon type. 2 decks. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
Eight cards are dealt to tableau piles, and two sets of eleven
|
||||||
|
cards are dealt to two reserve piles - one additional reserve
|
||||||
|
card is placed on top of both piles, overlapping them. This card
|
||||||
|
must be moved before any card from the other reserve piles is
|
||||||
|
moved. Only the top card from the reserves can be moved.
|
||||||
|
<p>
|
||||||
|
Tableau piles are built down by the same suit. Only one card at
|
||||||
|
a time can be moved between tableau piles, or a card from the
|
||||||
|
reserve can be moved to a tableau pile. However, you cannot
|
||||||
|
build on the reserves.
|
||||||
|
<p>
|
||||||
|
Aces can be moved to the foundations, which are then built up
|
||||||
|
by suit.
|
||||||
|
<p>
|
||||||
|
You can deal cards from the talon one at a time, and move these
|
||||||
|
cards to the tableau or foundation. No redeal is allowed.
|
12
html-src/rules/backboneplus.html
Normal file
12
html-src/rules/backboneplus.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<h1>Backbone +</h1>
|
||||||
|
<p>
|
||||||
|
Napoleon type. 2 decks. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="backbone.html">Backbone</a>,
|
||||||
|
but with ten tableau piles.
|
12
html-src/rules/smallbackbone.html
Normal file
12
html-src/rules/smallbackbone.html
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<h1>Small Backbone</h1>
|
||||||
|
<p>
|
||||||
|
Napoleon type. 2 decks. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundations.
|
||||||
|
|
||||||
|
<h3>Quick Description</h3>
|
||||||
|
<p>
|
||||||
|
Like <a href="backbone.html">Backbone</a>,
|
||||||
|
but with only nine cards in each reserve.
|
|
@ -303,7 +303,7 @@ class GI:
|
||||||
96, 100, 104, 105, 111, 112, 113, 130, 135, 139, 144, 146,
|
96, 100, 104, 105, 111, 112, 113, 130, 135, 139, 144, 146,
|
||||||
147, 148, 200, 201, 206, 224, 225, 229, 230, 233, 257, 258,
|
147, 148, 200, 201, 206, 224, 225, 229, 230, 233, 257, 258,
|
||||||
280, 281, 282, 283, 284, 334, 551, 552, 553, 572, 593, 674,
|
280, 281, 282, 283, 284, 334, 551, 552, 553, 572, 593, 674,
|
||||||
700, 737, 772, 810, 819, 22231,
|
700, 737, 772, 810, 819, 824, 22231,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
# KDE Patience 0.7.3 from KDE 1.1.2 (we have 6 out of 9 games)
|
# KDE Patience 0.7.3 from KDE 1.1.2 (we have 6 out of 9 games)
|
||||||
|
@ -423,7 +423,7 @@ class GI:
|
||||||
('fc-2.8', (343001,)),
|
('fc-2.8', (343001,)),
|
||||||
('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, 824)))
|
('fc-2.14', tuple(range(811, 825)))
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -300,6 +300,7 @@ class Backbone_BraidStack(OpenStack):
|
||||||
|
|
||||||
|
|
||||||
class Backbone(Game):
|
class Backbone(Game):
|
||||||
|
RESERVE_CARDS = 11
|
||||||
|
|
||||||
Hint_Class = CautiousDefaultHint
|
Hint_Class = CautiousDefaultHint
|
||||||
|
|
||||||
|
@ -309,7 +310,8 @@ class Backbone(Game):
|
||||||
|
|
||||||
# set window
|
# set window
|
||||||
w, h = l.XM+(rows+2)*l.XS, max(
|
w, h = l.XM+(rows+2)*l.XS, max(
|
||||||
l.YM+3*l.XS+10*l.YOFFSET, l.YM+2*l.YS+11*l.YOFFSET+l.TEXT_HEIGHT)
|
l.YM + 3 * l.XS + 10 * l.YOFFSET,
|
||||||
|
l.YM + 2 * l.YS + self.RESERVE_CARDS * l.YOFFSET + l.TEXT_HEIGHT)
|
||||||
self.setSize(w, h)
|
self.setSize(w, h)
|
||||||
|
|
||||||
# create stacks
|
# create stacks
|
||||||
|
@ -324,7 +326,7 @@ class Backbone(Game):
|
||||||
s.reserves.append(Backbone_BraidStack(x, y, self, max_accept=0))
|
s.reserves.append(Backbone_BraidStack(x, y, self, max_accept=0))
|
||||||
x += l.XS
|
x += l.XS
|
||||||
s.reserves.append(Backbone_BraidStack(x, y, self, max_accept=0))
|
s.reserves.append(Backbone_BraidStack(x, y, self, max_accept=0))
|
||||||
x, y = l.XM+(rows+1)*l.XS//2, l.YM+11*l.YOFFSET
|
x, y = l.XM+(rows+1)*l.XS//2, l.YM+self.RESERVE_CARDS*l.YOFFSET
|
||||||
s.reserves.append(BasicRowStack(x, y, self, max_accept=0))
|
s.reserves.append(BasicRowStack(x, y, self, max_accept=0))
|
||||||
|
|
||||||
x, y = l.XM, l.YM+l.YS
|
x, y = l.XM, l.YM+l.YS
|
||||||
|
@ -347,7 +349,7 @@ class Backbone(Game):
|
||||||
l.defaultStackGroups()
|
l.defaultStackGroups()
|
||||||
|
|
||||||
def startGame(self):
|
def startGame(self):
|
||||||
for i in range(10):
|
for i in range(self.RESERVE_CARDS - 1):
|
||||||
self.s.talon.dealRow(rows=self.s.reserves[:2], frames=0)
|
self.s.talon.dealRow(rows=self.s.reserves[:2], frames=0)
|
||||||
self.s.talon.dealRow(rows=self.s.reserves, frames=0)
|
self.s.talon.dealRow(rows=self.s.reserves, frames=0)
|
||||||
self.startDealSample()
|
self.startDealSample()
|
||||||
|
@ -362,6 +364,10 @@ class BackbonePlus(Backbone):
|
||||||
Backbone.createGame(self, rows=10)
|
Backbone.createGame(self, rows=10)
|
||||||
|
|
||||||
|
|
||||||
|
class SmallBackbone(Backbone):
|
||||||
|
RESERVE_CARDS = 9
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Big Braid
|
# * Big Braid
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
@ -644,3 +650,5 @@ registerGame(GameInfo(694, Casket, "Casket",
|
||||||
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
GI.GT_2DECK_TYPE, 2, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(717, Well, "Well",
|
registerGame(GameInfo(717, Well, "Well",
|
||||||
GI.GT_2DECK_TYPE, 2, 4, GI.SL_BALANCED))
|
GI.GT_2DECK_TYPE, 2, 4, GI.SL_BALANCED))
|
||||||
|
registerGame(GameInfo(824, SmallBackbone, "Small Backbone",
|
||||||
|
GI.GT_NAPOLEON, 2, 0, GI.SL_BALANCED))
|
||||||
|
|
|
@ -87,7 +87,13 @@ def latin1_to_ascii(n):
|
||||||
|
|
||||||
|
|
||||||
def latin1_normalize(n):
|
def latin1_normalize(n):
|
||||||
return re.sub(r"[^\w]", "", latin1_to_ascii(n).lower())
|
normal = re.sub(r"[^\w]", "", latin1_to_ascii(n).lower())
|
||||||
|
# Some game names end in a +, and would have the same normalized
|
||||||
|
# name as their counterpart. This is a failsafe to avoid duplicate
|
||||||
|
# name conflicts. Though there is probably a better way to do this.
|
||||||
|
if n.endswith("+"):
|
||||||
|
normal += "plus"
|
||||||
|
return normal
|
||||||
|
|
||||||
|
|
||||||
def format_time(t):
|
def format_time(t):
|
||||||
|
|
Loading…
Add table
Reference in a new issue