mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Unlimited redeal option for Hit or MIss game.
This commit is contained in:
parent
9493f79f9c
commit
1ec22ad16f
4 changed files with 46 additions and 10 deletions
|
@ -7,9 +7,14 @@ One-Deck game type. 1 deck. Varying number of redeals.
|
|||
Move all cards to the foundation.
|
||||
|
||||
<h3>Rules</h3>
|
||||
<p>As you draw cards from the talon, one at a time, you declare a card rank
|
||||
in sequence (ace to king, then start over from ace). If the card you draw
|
||||
matches the rank you declared, that is a "Hit", and the card may be moved
|
||||
to the foundation. Otherwise, it is a "Miss". You can continue to redeal
|
||||
as many times as you need, until you go through the entire deck twice in a
|
||||
row without getting a single "Hit".
|
||||
<p>As you draw cards from the talon, one at a time, declare a card rank
|
||||
in sequence (ace to king, then start over from ace). If the drawn card
|
||||
matches the declard rank, that is a "Hit", and the card may be moved to
|
||||
the foundation. Otherwise, it is a "Miss". You can continue to redeal
|
||||
as many times as you need, until you go through the entire deck twice in
|
||||
a row without getting a single "Hit".
|
||||
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
For a variation that allows unlimited redeals (often seen in other
|
||||
solitaire apps), see <a href="hitormissunlimited.html">Hit or Miss Unlimited</a>.
|
||||
|
|
22
html-src/rules/hitormissunlimited.html
Normal file
22
html-src/rules/hitormissunlimited.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<h1>Hit or Miss Unlimited</h1>
|
||||
<p>
|
||||
One-Deck game type. 1 deck. Unlimited redeals.
|
||||
|
||||
<h3>Object</h3>
|
||||
<p>
|
||||
Move all cards to the foundation.
|
||||
|
||||
<h3>Quick Description</h3>
|
||||
<p>
|
||||
Just like <a href="hitormiss.html">Hit or Miss</a>,
|
||||
but with unlimited redeals.
|
||||
|
||||
<h3>Notes</h3>
|
||||
<p>
|
||||
The traditional rules of Hit or Miss only allow you to go through
|
||||
the deck twice without getting a hit, but this rule is often
|
||||
overlooked due to the extreme difficulty of winning the game it
|
||||
causes. Most computer versions of Hit or Miss do not use this
|
||||
rule, but when this rule is omitted, the game is always won unless
|
||||
the player gets stuck with a multiple of 13 cards left. This
|
||||
version does not use this rule, while Hit or Miss does.
|
|
@ -546,12 +546,13 @@ class GI:
|
|||
tuple(range(22217, 22219))),
|
||||
('fc-2.14', tuple(range(811, 827))),
|
||||
('fc-2.15', tuple(range(827, 855)) + tuple(range(22400, 22407))),
|
||||
('dev', tuple(range(855, 865)))
|
||||
('dev', tuple(range(855, 866)))
|
||||
)
|
||||
|
||||
# deprecated - the correct way is to or a GI.GT_XXX flag
|
||||
# in the registerGame() call
|
||||
_CHILDREN_GAMES = [16, 33, 55, 90, 91, 96, 97, 176, 328, 329, 862, 903, ]
|
||||
_CHILDREN_GAMES = [16, 33, 55, 90, 91, 96, 97, 176, 328, 329, 862, 865,
|
||||
903, ]
|
||||
|
||||
_OPEN_GAMES = []
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ from pysollib.stack import \
|
|||
WasteStack, \
|
||||
WasteTalonStack
|
||||
from pysollib.util import ANY_SUIT, RANKS, \
|
||||
UNLIMITED_REDEALS, \
|
||||
VARIABLE_REDEALS
|
||||
|
||||
|
||||
|
@ -92,12 +93,12 @@ class HitOrMiss_Waste(WasteStack):
|
|||
# ************************************************************************
|
||||
|
||||
class HitOrMiss(Game):
|
||||
MaxRounds = VARIABLE_REDEALS
|
||||
|
||||
def createGame(self):
|
||||
layout, s = Layout(self), self.s
|
||||
self.rank = -1
|
||||
self.deadDeals = 1
|
||||
self.max_rounds = VARIABLE_REDEALS
|
||||
self.setSize(layout.XM + 4 * layout.XS, layout.YM + 2 * layout.YS)
|
||||
x, y = layout.XM + 3 * layout.XS // 2, layout.YM
|
||||
stack = HitOrMiss_Foundation(x, y, self, ANY_SUIT,
|
||||
|
@ -106,7 +107,7 @@ class HitOrMiss(Game):
|
|||
layout.createText(stack, 'ne')
|
||||
x, y = layout.XM+layout.XS, layout.YM+layout.YS
|
||||
s.talon = HitOrMiss_Talon(x, y, self,
|
||||
max_rounds=VARIABLE_REDEALS, num_deal=1)
|
||||
max_rounds=self.MaxRounds, num_deal=1)
|
||||
layout.createText(s.talon, 'nw')
|
||||
|
||||
x += layout.XS
|
||||
|
@ -160,7 +161,14 @@ class HitOrMiss(Game):
|
|||
return Game.getSnapshotHash(self) + str(self.rank)
|
||||
|
||||
|
||||
class HitOrMissUnlimited(HitOrMiss):
|
||||
MaxRounds = UNLIMITED_REDEALS
|
||||
|
||||
|
||||
# register the game
|
||||
registerGame(GameInfo(774, HitOrMiss, "Hit or Miss",
|
||||
GI.GT_1DECK_TYPE, 1, VARIABLE_REDEALS,
|
||||
GI.SL_LUCK, altnames=("Roll Call",)))
|
||||
registerGame(GameInfo(865, HitOrMissUnlimited, "Hit or Miss Unlimited",
|
||||
GI.GT_1DECK_TYPE, 1, UNLIMITED_REDEALS,
|
||||
GI.SL_LUCK))
|
||||
|
|
Loading…
Add table
Reference in a new issue