Skip to content

Commit 5e67ff3

Browse files
committed
Add Double Eight Off game
1 parent 9a2cde9 commit 5e67ff3

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

html-src/rules/doubleeightoff.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<h1>Double Eight Off</h1>
2+
<p>
3+
FreeCell type. 2 decks. No redeal.
4+
5+
<h3>Object</h3>
6+
<p>
7+
Move all cards to the foundations.
8+
9+
<h3>Quick Description</h3>
10+
<p>
11+
Like <a href="eightoff.html">Eight Off</a>,
12+
but with two decks and twelve piles of eight cards each,
13+
with all the free cells starting full.

pysollib/gamedb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def _callback(gi, gt=game_type):
607607
('fc-3.4', tuple(range(971, 981)) + tuple(range(5419, 5421)) +
608608
tuple(range(16683, 16686)) + tuple(range(18005, 18007)) +
609609
(44, 526, 5906, 22399,)),
610-
('dev', tuple(range(981, 985)) + tuple(range(16686, 16687))),
610+
('dev', tuple(range(981, 986)) + tuple(range(16686, 16687))),
611611
)
612612

613613
# deprecated - the correct way is to or a GI.GT_XXX flag

pysollib/games/bakersgame.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class EightOff(KingOnlyBakersGame):
7373
def createGame(self, rows=8, reserves=8):
7474
# create layout
7575
l, s = Layout(self), self.s
76+
decks = self.gameinfo.decks
7677

7778
# set window
7879
# (piles up to 16 cards are playable without
@@ -82,10 +83,11 @@ def createGame(self, rows=8, reserves=8):
8283
self.setSize(l.XM + maxrows*l.XS, l.YM + l.YS + h + l.YS)
8384

8485
# create stacks
85-
x, y = l.XM + (maxrows-4)*l.XS//2, l.YM
86+
x, y = l.XM + (maxrows - (4 * decks)) * l.XS // 2, l.YM
8687
for i in range(4):
87-
s.foundations.append(SS_FoundationStack(x, y, self, i))
88-
x = x + l.XS
88+
for j in range(decks):
89+
s.foundations.append(SS_FoundationStack(x, y, self, i))
90+
x = x + l.XS
8991
x, y = l.XM + (maxrows-rows)*l.XS//2, y + l.YS
9092
for i in range(rows):
9193
s.rows.append(self.RowStack_Class(x, y, self))
@@ -111,6 +113,17 @@ def startGame(self):
111113
self.s.talon.dealRow(rows=[r[0], r[2], r[4], r[6]])
112114

113115

116+
class DoubleEightOff(EightOff):
117+
118+
def createGame(self, rows=8, reserves=8):
119+
EightOff.createGame(self, rows=12)
120+
121+
def startGame(self):
122+
self._startDealNumRows(7)
123+
self.s.talon.dealRow()
124+
self.s.talon.dealRow(rows=self.s.reserves)
125+
126+
114127
# ************************************************************************
115128
# * Seahaven Towers (Baker's Game in a different layout)
116129
# ************************************************************************
@@ -328,3 +341,5 @@ def fillStack(self, stack):
328341
registerGame(GameInfo(713, Flipper, "Flipper",
329342
GI.GT_FREECELL | GI.GT_OPEN | GI.GT_ORIGINAL, 1, 0,
330343
GI.SL_MOSTLY_SKILL))
344+
registerGame(GameInfo(985, DoubleEightOff, "Double Eight Off",
345+
GI.GT_FREECELL | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL))

0 commit comments

Comments
 (0)