mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Ishido initial deals should include every color/symbol.
This commit is contained in:
parent
3e5631dbb4
commit
9db799f330
2 changed files with 18 additions and 2 deletions
|
@ -10,7 +10,8 @@ Move all tiles to the playing area.
|
||||||
<p>
|
<p>
|
||||||
The tiles are played to an grid of eight rows of twelve columns each.
|
The tiles are played to an grid of eight rows of twelve columns each.
|
||||||
At the start of the game, a tile is placed in each corner, and two are
|
At the start of the game, a tile is placed in each corner, and two are
|
||||||
placed in two diagonally adjacent spaces in the center.
|
placed in two diagonally adjacent spaces in the center. The initially
|
||||||
|
placed tiles include one of each color and one of each symbol.
|
||||||
<p>
|
<p>
|
||||||
Tiles are drawn from the talon one at a time, and can be played to the
|
Tiles are drawn from the talon one at a time, and can be played to the
|
||||||
main playing area. A tile can only be played if it is adjacent to
|
main playing area. A tile can only be played if it is adjacent to
|
||||||
|
@ -26,4 +27,4 @@ playing area.
|
||||||
<h3>History</h3>
|
<h3>History</h3>
|
||||||
<p>
|
<p>
|
||||||
Ishido was originally published as a video game "Ishido: The Way of Stones"
|
Ishido was originally published as a video game "Ishido: The Way of Stones"
|
||||||
in 1990. It has since been recreated many times.
|
by Accolade in 1990. It has since been recreated many times.
|
||||||
|
|
|
@ -111,6 +111,21 @@ class Ishido(Game):
|
||||||
def isGameWon(self):
|
def isGameWon(self):
|
||||||
return len(self.s.talon.cards) == 0
|
return len(self.s.talon.cards) == 0
|
||||||
|
|
||||||
|
def _shuffleHook(self, cards):
|
||||||
|
# prepare first cards
|
||||||
|
symbols = []
|
||||||
|
colors = []
|
||||||
|
topcards = []
|
||||||
|
for c in cards[:]:
|
||||||
|
if c.suit not in colors and c.rank not in symbols:
|
||||||
|
topcards.append(c)
|
||||||
|
cards.remove(c)
|
||||||
|
symbols.append(c.rank)
|
||||||
|
colors.append(c.suit)
|
||||||
|
if len(colors) >= 6 or len(symbols) >= 6:
|
||||||
|
break
|
||||||
|
return cards + topcards
|
||||||
|
|
||||||
def isValidPlay(self, playSpace, playRank, playSuit):
|
def isValidPlay(self, playSpace, playRank, playSuit):
|
||||||
# check that there's an adjacent card
|
# check that there's an adjacent card
|
||||||
adjacent = self.getAdjacent(playSpace)
|
adjacent = self.getAdjacent(playSpace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue