mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Clarified correct vs. incorrect version of All in a Row game.
This commit is contained in:
parent
4aac672ebd
commit
2b6aa110cc
4 changed files with 118 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
<h1>All in a Row</h1>
|
<h1>All in a Row</h1>
|
||||||
<p>
|
<p>
|
||||||
Fan game type. 1 deck. No redeal.
|
Golf game type. 1 deck. No redeal.
|
||||||
|
|
||||||
<h3>Object</h3>
|
<h3>Object</h3>
|
||||||
<p>
|
<p>
|
||||||
|
@ -8,13 +8,14 @@ Move all cards to the bottom in a single row.
|
||||||
|
|
||||||
<h3>Rules</h3>
|
<h3>Rules</h3>
|
||||||
<p>
|
<p>
|
||||||
|
The tableau is arranged in thirteen piles of four cards each.
|
||||||
The row builds up or down by rank ignoring color and suit, wrapping
|
The row builds up or down by rank ignoring color and suit, wrapping
|
||||||
around from King to Ace and from Ace to King.
|
around from King to Ace and from Ace to King.
|
||||||
<p>
|
<p>
|
||||||
There is no building on the tableau piles, and spaces
|
There is no building on the tableau piles, and spaces
|
||||||
are not filled. Only top cards from reach pile can be moved.
|
are not filled. Only top cards from reach pile can be moved.
|
||||||
<p>
|
<p>
|
||||||
The first card the bottom row can be arbitrarily selected from the
|
The first card in the bottom row can be arbitrarily selected from the
|
||||||
top of any pile.
|
top of any pile.
|
||||||
|
|
||||||
<h3>Notes</h3>
|
<h3>Notes</h3>
|
||||||
|
@ -25,3 +26,11 @@ top of any pile.
|
||||||
<p>
|
<p>
|
||||||
Plan carefully - one wrong move and you may never
|
Plan carefully - one wrong move and you may never
|
||||||
be able to untangle the mess.
|
be able to untangle the mess.
|
||||||
|
|
||||||
|
<h3>History</h3>
|
||||||
|
<p>
|
||||||
|
This version of All in a Row is a <a href="blackhole.html">Black Hole</a>
|
||||||
|
variant that is actually a misinterpretation of the original game's rules.
|
||||||
|
This variant is also known as Quasar to better distinguish it from the
|
||||||
|
original game. In PySol, the original game can be found as
|
||||||
|
<a href="allinarowii.html">All in a Row II</a>.
|
||||||
|
|
31
html-src/rules/allinarowii.html
Normal file
31
html-src/rules/allinarowii.html
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<h1>All in a Row II</h1>
|
||||||
|
<p>
|
||||||
|
Golf game type. 1 deck. No redeal.
|
||||||
|
|
||||||
|
<h3>Object</h3>
|
||||||
|
<p>
|
||||||
|
Move all cards to the foundation.
|
||||||
|
|
||||||
|
<h3>Rules</h3>
|
||||||
|
<p>
|
||||||
|
The tableau is arranged in thirteen piles of four cards each.
|
||||||
|
Cards can be moved from the tableau to a reserve, which is built
|
||||||
|
up by rank, regardless of suit. A sequence of cards can then be
|
||||||
|
moved from the reserve to the foundation (single cards can't be
|
||||||
|
moved).
|
||||||
|
<p>
|
||||||
|
There is no building on the tableau piles, and spaces
|
||||||
|
are not filled. Only top cards from reach pile can be moved.
|
||||||
|
<p>
|
||||||
|
The first card of each sequence in the reserve can be arbitrarily
|
||||||
|
selected from the top of any pile.
|
||||||
|
|
||||||
|
<h3>Notes</h3>
|
||||||
|
<p>
|
||||||
|
<i>Autodrop</i> is disabled for this game.
|
||||||
|
|
||||||
|
<h3>History</h3>
|
||||||
|
<p>
|
||||||
|
This is the correct, original variant of the game All in a Row.
|
||||||
|
<a href="allinarow.html">The other game</a> is based on a common
|
||||||
|
misinterpretation of the game's rules.
|
|
@ -551,7 +551,7 @@ class GI:
|
||||||
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, 891)))
|
('dev', tuple(range(855, 892)))
|
||||||
)
|
)
|
||||||
|
|
||||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||||
|
|
|
@ -512,6 +512,77 @@ class AllInARow(BlackHole):
|
||||||
self._startDealNumRowsAndDealSingleRow(3)
|
self._startDealNumRowsAndDealSingleRow(3)
|
||||||
|
|
||||||
|
|
||||||
|
# ************************************************************************
|
||||||
|
# * All in a Row II
|
||||||
|
# ************************************************************************
|
||||||
|
|
||||||
|
class AllInARowII_Reserve(RK_RowStack):
|
||||||
|
getBottomImage = RK_RowStack._getReserveBottomImage
|
||||||
|
|
||||||
|
def getHelp(self):
|
||||||
|
return _('Reserve. Build down regardless of suit.')
|
||||||
|
|
||||||
|
|
||||||
|
class AllInARowII_Foundation(AbstractFoundationStack):
|
||||||
|
def acceptsCards(self, from_stack, cards):
|
||||||
|
if from_stack not in self.game.s.reserves:
|
||||||
|
return False
|
||||||
|
if len(cards) == 1 or len(cards) != len(from_stack.cards):
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
class AllInARowII(Game):
|
||||||
|
|
||||||
|
def createGame(self):
|
||||||
|
# create layout
|
||||||
|
layout, s = Layout(self), self.s
|
||||||
|
|
||||||
|
# set window
|
||||||
|
h = layout.YM+layout.YS + 4 * layout.YOFFSET
|
||||||
|
self.setSize(layout.XM + 7 * layout.XS,
|
||||||
|
3 * layout.YM + 3 * h + layout.YS)
|
||||||
|
|
||||||
|
# create stacks
|
||||||
|
x, y = layout.XM, layout.YM
|
||||||
|
for i in range(7):
|
||||||
|
s.rows.append(OpenStack(x, y, self, max_accept=0))
|
||||||
|
x += layout.XS
|
||||||
|
x, y = layout.XM, layout.YM+h
|
||||||
|
for i in range(6):
|
||||||
|
s.rows.append(OpenStack(x, y, self, max_accept=0))
|
||||||
|
x += layout.XS
|
||||||
|
for r in s.rows:
|
||||||
|
r.CARD_XOFFSET, r.CARD_YOFFSET = 0, layout.YOFFSET
|
||||||
|
|
||||||
|
x, y = layout.XM, self.height-layout.YS
|
||||||
|
stack = AllInARowII_Foundation(
|
||||||
|
x, y, self, ANY_SUIT, dir=0, mod=13, max_move=0, max_cards=52,
|
||||||
|
base_rank=ANY_RANK)
|
||||||
|
s.foundations.append(stack)
|
||||||
|
layout.createText(stack, 'se')
|
||||||
|
|
||||||
|
y -= layout.YS
|
||||||
|
stack = AllInARowII_Reserve(
|
||||||
|
x, y, self, dir=1, mod=13, max_cards=52, base_rank=ANY_RANK)
|
||||||
|
s.reserves.append(stack)
|
||||||
|
stack.CARD_XOFFSET, stack.CARD_YOFFSET = ((self.width - layout.XS)
|
||||||
|
// 51, 0)
|
||||||
|
x = self.width-layout.XS
|
||||||
|
s.talon = InitialDealTalonStack(x, y, self)
|
||||||
|
|
||||||
|
# define stack-groups
|
||||||
|
layout.defaultStackGroups()
|
||||||
|
|
||||||
|
def startGame(self):
|
||||||
|
self._startDealNumRowsAndDealSingleRow(3)
|
||||||
|
|
||||||
|
def getStuck(self):
|
||||||
|
if len(self.s.reserves[0].cards) > 1:
|
||||||
|
return True
|
||||||
|
return Game.getStuck(self)
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Robert
|
# * Robert
|
||||||
# * Bobby
|
# * Bobby
|
||||||
|
@ -1348,7 +1419,8 @@ registerGame(GameInfo(267, FourLeafClovers, "Four Leaf Clovers",
|
||||||
registerGame(GameInfo(281, Escalator, "Escalator",
|
registerGame(GameInfo(281, Escalator, "Escalator",
|
||||||
GI.GT_GOLF, 1, 0, GI.SL_BALANCED))
|
GI.GT_GOLF, 1, 0, GI.SL_BALANCED))
|
||||||
registerGame(GameInfo(405, AllInARow, "All in a Row",
|
registerGame(GameInfo(405, AllInARow, "All in a Row",
|
||||||
GI.GT_GOLF | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
GI.GT_GOLF | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL,
|
||||||
|
altnames=("Quasar",)))
|
||||||
registerGame(GameInfo(432, Robert, "Robert",
|
registerGame(GameInfo(432, Robert, "Robert",
|
||||||
GI.GT_GOLF, 1, 2, GI.SL_LUCK))
|
GI.GT_GOLF, 1, 2, GI.SL_LUCK))
|
||||||
registerGame(GameInfo(551, DiamondMine, "Diamond Mine",
|
registerGame(GameInfo(551, DiamondMine, "Diamond Mine",
|
||||||
|
@ -1402,3 +1474,5 @@ registerGame(GameInfo(868, Bobby, "Bobby",
|
||||||
GI.GT_GOLF, 1, 2, GI.SL_LUCK))
|
GI.GT_GOLF, 1, 2, GI.SL_LUCK))
|
||||||
registerGame(GameInfo(880, Carcassonne, "Carcassonne",
|
registerGame(GameInfo(880, Carcassonne, "Carcassonne",
|
||||||
GI.GT_NAPOLEON | GI.GT_OPEN, 2, 0, GI.SL_BALANCED))
|
GI.GT_NAPOLEON | GI.GT_OPEN, 2, 0, GI.SL_BALANCED))
|
||||||
|
registerGame(GameInfo(891, AllInARowII, "All in a Row II",
|
||||||
|
GI.GT_GOLF | GI.GT_OPEN, 1, 0, GI.SL_MOSTLY_SKILL))
|
||||||
|
|
Loading…
Add table
Reference in a new issue