1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Added Binary Star game.

This commit is contained in:
Joe R 2023-12-26 10:43:31 -05:00
parent 5852bad127
commit 499439bc13
3 changed files with 67 additions and 15 deletions

View file

@ -0,0 +1,19 @@
<h1>Binary Star</h1>
<p>
Golf type. 2 decks. No redeal.
<h3>Object</h3>
<p>
Move all cards to the foundations.
<h3>Quick Description</h3>
<p>
Just like <a href="blackhole.html">Black Hole</a>,
but with two decks, six cards per pile, and a second
foundation, starting with a king of hearts. It does
not matter how many cards end up in each foundation at
the end of the game.
<h3>Notes</h3>
<p>
<i>Autodrop</i> is disabled for this game.

View file

@ -434,12 +434,12 @@ class GI:
#
# still missing:
# Ace of Hearts, Agnes Three, Antares, Avenue, Baker's Fan,
# Baker's Spider, Bedeviled, Binding, Black Holes,
# Black Spider, California, Club, Color Cell, Cornelius,
# Desert Fox, Double Antares, Double Antarctica,
# Double Arctica, Double Baker's Spider, Double Cascade,
# Double Majesty, Double Spidercells, Doublet Cell 5, Doubt,
# Dream Fan, Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten,
# Baker's Spider, Bedeviled, Binding, Black Spider,
# California, Club, Color Cell, Cornelius, Desert Fox,
# Double Antares, Double Antarctica, Double Arctica,
# Double Baker's Spider, Double Cascade, Double Majesty,
# Double Spidercells, Doublet Cell 5, Doubt, Dream Fan,
# Dumfries Cell, Falcon Wing, Fan Nine, Four By Ten,
# FreeCell AK, Gaps Alter, Gaps Diff, George V,
# Grandmother's Clock, In a Frame, Inverted FreeCell, Kings,
# Klondike FreeCell, La Cabane, La Double Entente,
@ -461,7 +461,7 @@ class GI:
398, 405, 415, 416, 425, 451, 453, 461, 464, 466, 467, 476,
480, 484, 511, 512, 513, 516, 561, 610, 613, 625, 629, 631,
638, 641, 647, 650, 655, 678, 684, 702, 734, 751, 784, 825,
829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933
829, 834, 837, 844, 862, 867, 880, 889, 901, 911, 933, 941
)),
# xpat2 1.06 (we have 14 out of 16 games)
@ -507,7 +507,8 @@ class GI:
("Peter Voke", (876,)),
("Thomas Warfield", (189, 264, 300, 320, 336, 337, 359,
415, 427, 458, 495, 496, 497, 508,
800, 814, 820, 825, 889, 911, 926)),
800, 814, 820, 825, 889, 911, 926,
941)),
("Mary Whitmore Jones", (421, 624,)),
("Jan Wolter", (917, 939,)),
)
@ -592,7 +593,7 @@ class GI:
('fc-2.20', tuple(range(855, 897))),
('fc-2.21', tuple(range(897, 900)) + tuple(range(11014, 11017)) +
tuple(range(13160, 13163)) + (16682,)),
('dev', tuple(range(906, 941)) + tuple(range(11017, 11020)) +
('dev', tuple(range(906, 942)) + tuple(range(11017, 11020)) +
tuple(range(5600, 5624)) + tuple(range(18000, 18005)) +
tuple(range(22303, 22311)) + tuple(range(22353, 22361))),
)

View file

@ -360,6 +360,8 @@ class BlackHole(Game):
Hint_Class = Golf_Hint
Solver_Class = BlackHoleSolverWrapper(preset='black_hole')
FOUNDATIONS = 1
#
# game layout
#
@ -369,8 +371,9 @@ class BlackHole(Game):
layout, s = Layout(self), self.s
# set window
w = max(2*layout.XS, layout.XS+(playcards-1)*layout.XOFFSET)
self.setSize(layout.XM + 5*w, layout.YM + 4*layout.YS)
w = max((1 + self.FOUNDATIONS) * layout.XS,
layout.XS + (playcards - 1) * layout.XOFFSET)
self.setSize(layout.XM + 5 * w, layout.YM + 4 * layout.YS)
# create stacks
y = layout.YM
@ -390,9 +393,12 @@ class BlackHole(Game):
r.CARD_XOFFSET = layout.XOFFSET
r.CARD_YOFFSET = 0
x, y = layout.XM + 2*w, layout.YM + 3*layout.YS//2
s.foundations.append(BlackHole_Foundation(x, y, self, suit=ANY_SUIT,
dir=0, mod=13, max_move=0, max_cards=52))
layout.createText(s.foundations[0], "s")
for f in range(self.FOUNDATIONS):
s.foundations.append(BlackHole_Foundation(x, y, self,
suit=ANY_SUIT, dir=0, mod=13, max_move=0,
max_cards=52 * self.gameinfo.decks))
layout.createText(s.foundations[f], "s")
x += layout.XS
x, y = layout.XM + 4*w, self.height - layout.YS
s.talon = InitialDealTalonStack(x, y, self)
@ -422,6 +428,29 @@ class BlackHole(Game):
return ((), self.sg.dropstacks, self.sg.dropstacks)
# ************************************************************************
# * Binary Star
# ************************************************************************
class BinaryStar(BlackHole):
RowStack_Class = StackWrapper(
ReserveStack, max_accept=0, max_cards=6)
# TODO: Solver support
Solver_Class = None # BlackHoleSolverWrapper(preset='binary_star')
FOUNDATIONS = 2
def _shuffleHook(self, cards):
# move Ace and king to bottom of the Talon
# (i.e. last cards to be dealt)
return self._shuffleHookMoveToBottom(
cards, lambda c: (c.id in (13, 38), c.suit), 2)
def startGame(self):
self._startDealNumRows(5)
self.s.talon.dealRow()
self.s.talon.dealRow(rows=self.s.foundations)
# ************************************************************************
# * Four Leaf Clovers
# ************************************************************************
@ -784,7 +813,7 @@ class Dolphin(Game):
s.reserves.append(ReserveStack(x, y, self))
x += layout.XS
x += dx
max_cards = 52*self.gameinfo.decks
max_cards = 52 * self.gameinfo.decks
s.foundations.append(RK_FoundationStack(x, y, self,
base_rank=ANY_RANK, mod=13, max_cards=max_cards))
layout.createText(s.foundations[0], 'ne')
@ -1504,3 +1533,6 @@ registerGame(GameInfo(892, DoublePutt, "Double Putt",
registerGame(GameInfo(906, Thieves, "Thieves",
GI.GT_GOLF, 1, 0, GI.SL_BALANCED,
subcategory=GI.GS_JOKER_DECK, trumps=list(range(2))))
registerGame(GameInfo(941, BinaryStar, "Binary Star",
GI.GT_GOLF | GI.GT_OPEN, 2, 0, GI.SL_MOSTLY_SKILL,
altnames=("Black Holes",)))