Skip to content

Commit df2c60e

Browse files
committed
Add Antares game
1 parent 3ea0722 commit df2c60e

File tree

3 files changed

+115
-27
lines changed

3 files changed

+115
-27
lines changed

html-src/rules/antares.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h1>Antares</h1>
2+
<p>
3+
FreeCell type. 1 deck. No redeal.
4+
5+
<h3>Object</h3>
6+
<p>
7+
Move all cards to the foundations.
8+
9+
<h3>Rules</h3>
10+
<p>
11+
There are eight tableau piles, divided into two sets. The first set of tableau
12+
piles contains four piles, each with seven cards dealt to it, and are built
13+
down by alternate color, with only one card being moved at a time. The second
14+
set consists of four piles, with six cards dealt to each, and are built down by
15+
same suit, and cards can be moved regardless of sequence. Empty piles on the
16+
left stacks can be filled with any card, whereas piles on the right can only be
17+
filled with kings.
18+
<p>
19+
A sequence can be moved from one set to the other, regardless of whether it matches
20+
the rules of the piles it moved to, but in this case, the sequence cannot be moved
21+
further.
22+
<p>
23+
The foundations are built up by same suit, from ace to king. The game is won if
24+
all cards are moved to the foundations.
25+
26+
<h3>History</h3>
27+
<p>
28+
Demons and Thieves is a combination of FreeCell-type and Scorpion-type
29+
games. It was invented by Thomas Warfield.

pysollib/gamedb.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -437,23 +437,22 @@ def _callback(gi, gt=game_type):
437437
# from XM Solitaire should be researched before being added to PySol.
438438
#
439439
# still missing:
440-
# Agnes Three, Antares, Avenue, Baker's Fan, Baker's Spider,
441-
# Bedeviled, Binding, Black Spider, California, Color Cell,
442-
# Cornelius, Desert Fox, Double Antares, Double Antarctica,
443-
# Double Arctica, Double Baker's Spider, Double Cascade,
444-
# Double Majesty, Double Spidercells, Doublet Cell 5, Doubt,
445-
# Dream Fan, Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten,
446-
# FreeCell AK, Gaps Alter, Gaps Diff, George V,
447-
# Grandmother's Clock, In a Frame, Inverted FreeCell, Kings,
448-
# Klondike FreeCell, La Cabane, La Double Entente,
449-
# Little Gazette, Magic FreeCell, Mini Gaps, Montreal,
450-
# Napoleon at Iena, Napoleon at Waterloo, Napoleon's Guards,
451-
# Oasis, Opera, Ordered Suits, Osmotic FreeCell, Pair FreeCell,
452-
# Pairs 2, Reserved Thirteens, Sept Piles 0, Short Solitaire,
453-
# Simple Alternations, Smart Osmosis, Step By Step,
454-
# Stripped FreeCell, Tarantula, Triple Dispute, Trusty Twenty,
455-
# Two Ways 3, Up Or Down, Versailles, Vertical FreeCell,
456-
# Wasp Baby, Yukon FreeCell
440+
# Agnes Three, Avenue, Baker's Fan, Baker's Spider, Bedeviled,
441+
# Binding, Black Spider, California, Color Cell, Cornelius,
442+
# Desert Fox, Double Antares, Double Antarctica, Double Arctica,
443+
# Double Baker's Spider, Double Cascade, Double Majesty,
444+
# Double Spidercells, Doublet Cell 5, Doubt, Dream Fan,
445+
# Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten, FreeCell AK,
446+
# Gaps Alter, Gaps Diff, George V, Grandmother's Clock,
447+
# In a Frame, Inverted FreeCell, Kings, Klondike FreeCell,
448+
# La Cabane, La Double Entente, Little Gazette, Magic FreeCell,
449+
# Mini Gaps, Montreal, Napoleon at Iena, Napoleon at Waterloo,
450+
# Napoleon's Guards, Oasis, Opera, Ordered Suits,
451+
# Osmotic FreeCell, Pair FreeCell, Pairs 2, Reserved Thirteens,
452+
# Sept Piles 0, Short Solitaire, Simple Alternations,
453+
# Smart Osmosis, Step By Step, Stripped FreeCell, Tarantula,
454+
# Triple Dispute, Trusty Twenty, Two Ways 3, Up Or Down,
455+
# Versailles, Vertical FreeCell, Wasp Baby, Yukon FreeCell
457456
("XM Solitaire", (
458457
2, 8, 9, 13, 15, 18, 19, 20, 29, 30, 31, 34, 36, 38, 41, 42,
459458
45, 46, 50, 53, 54, 56, 57, 64, 77, 78, 86, 96, 97, 98, 105,
@@ -465,7 +464,7 @@ def _callback(gi, gt=game_type):
465464
476, 480, 484, 511, 512, 513, 516, 561, 610, 613, 625, 629,
466465
631, 638, 641, 647, 650, 655, 678, 684, 702, 734, 751, 784,
467466
825, 829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933,
468-
941, 947, 953, 966
467+
941, 947, 953, 966, 983
469468
)),
470469

471470
# xpat2 1.06 (we have 14 out of 16 games)
@@ -513,7 +512,7 @@ def _callback(gi, gt=game_type):
513512
("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359,
514513
415, 427, 458, 495, 496, 497, 508,
515514
800, 814, 820, 825, 889, 911, 926,
516-
941, 966)),
515+
941, 966, 983)),
517516
("Mary Whitmore Jones", (421, 624,)),
518517
("Jan Wolter", (917, 939, 946, 963,)),
519518
)
@@ -607,7 +606,7 @@ def _callback(gi, gt=game_type):
607606
('fc-3.4', tuple(range(971, 981)) + tuple(range(5419, 5421)) +
608607
tuple(range(16683, 16686)) + tuple(range(18005, 18007)) +
609608
(44, 526, 5906, 22399,)),
610-
('dev', tuple(range(981, 983)) + tuple(range(16686, 16687))),
609+
('dev', tuple(range(981, 984)) + tuple(range(16686, 16687))),
611610
)
612611

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

pysollib/games/demonsandthieves.py

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
from pysollib.layout import Layout
44
from pysollib.pysoltk import MfxCanvasText
55
from pysollib.stack import \
6-
AC_RowStack, \
7-
OpenStack, \
8-
SS_FoundationStack, \
9-
SS_RowStack, \
10-
WasteStack, \
11-
WasteTalonStack
12-
from pysollib.util import ANY_RANK, RANKS
6+
AC_RowStack, \
7+
InitialDealTalonStack, \
8+
OpenStack, \
9+
ReserveStack, \
10+
SS_FoundationStack, \
11+
SS_RowStack, \
12+
WasteStack, \
13+
WasteTalonStack, \
14+
Yukon_SS_RowStack
15+
from pysollib.util import ANY_RANK, KING, RANKS
1316

1417

1518
# ************************************************************************
@@ -36,6 +39,7 @@ class DemonsAndThieves_SS_RowStack(DemonsAndThieves_StackMethods, SS_RowStack):
3639

3740

3841
class DemonsAndThieves(Game):
42+
3943
def createGame(self, max_rounds=3, num_deal=1,
4044
text=True, round_text=True, dir=-1):
4145
# create layout
@@ -170,6 +174,62 @@ def _saveGameHook(self, p):
170174
p.dump(self.base_card.id)
171175

172176

177+
# ************************************************************************
178+
# * Antares
179+
# ************************************************************************
180+
181+
class Antares(Game):
182+
183+
def createGame(self):
184+
# create layout
185+
lay, s = Layout(self), self.s
186+
decks = self.gameinfo.decks
187+
188+
# (piles up to 20 cards are playable in default window size)
189+
h = max(3 * lay.YS, lay.YS + 13 * 10)
190+
self.setSize(
191+
lay.XM + 8.5 * lay.XS + lay.XM,
192+
lay.YM + lay.YS + lay.TEXT_HEIGHT + h)
193+
194+
x, y = lay.XM, h
195+
self.s.talon = InitialDealTalonStack(x, y, self)
196+
197+
# create stacks
198+
x, y = lay.XM, lay.YM
199+
for i in range(4):
200+
for j in range(decks):
201+
s.reserves.append(ReserveStack(x, y, self, max_accept=1))
202+
x += lay.XS
203+
x += (lay.XS * .5)
204+
for i in range(4):
205+
for j in range(decks):
206+
s.foundations.append(SS_FoundationStack(x, y, self, i,
207+
max_move=0))
208+
x += lay.XS
209+
210+
x, y = lay.XM, lay.YM + lay.YS
211+
212+
for i in range(4):
213+
s.rows.append(DemonsAndThieves_AC_RowStack(x, y, self,
214+
base_rank=ANY_RANK))
215+
x += lay.XS
216+
x += (lay.XS * .5)
217+
for i in range(4):
218+
s.rows.append(Yukon_SS_RowStack(x, y, self, base_rank=KING))
219+
x += lay.XS
220+
221+
# define stack-groups
222+
lay.defaultStackGroups()
223+
224+
def startGame(self):
225+
self._startDealNumRows(5)
226+
self.s.talon.dealRow()
227+
r = self.s.rows
228+
self.s.talon.dealRow(rows=r[:4])
229+
230+
173231
# register the game
174232
registerGame(GameInfo(889, DemonsAndThieves, "Demons and Thieves",
175233
GI.GT_FORTY_THIEVES, 2, 2, GI.SL_MOSTLY_SKILL))
234+
registerGame(GameInfo(983, Antares, "Antares",
235+
GI.GT_FREECELL, 1, 0, GI.SL_MOSTLY_SKILL))

0 commit comments

Comments
 (0)