shenzhen-solitaire.py
def moves_from_spaces(self):
        """Generate all the moves from the spaces, if any legal."""
        for sdx, card in enumerate(self.spaces):
            for pdx, pile in enumerate(self.piles):
                if not pile or card.goes_on(pile[-1]):
                    new_b = deepcopy(self)
                    new_b.piles[pdx].append(new_b.spaces.pop(sdx))
                    yield new_b, ("Move %s from spaces down to %s" %
                                  (card, pdx + 1), DOWN_SPACES,
                                  (str(card), pdx))
Generate all the moves from the spaces, if any legal.
Generate all the moves from the spaces, if any legal.
Generate all the moves from the spaces if any legal .
def moves_from_spaces(self):
        for sdx, card in enumerate(self.spaces):
            for pdx, pile in enumerate(self.piles):
                if not pile or card.goes_on(pile[-1]):
                    new_b = deepcopy(self)
                    new_b.piles[pdx].append(new_b.spaces.pop(sdx))
                    yield new_b, ("Move %s from spaces down to %s" %
                                  (card, pdx + 1), DOWN_SPACES,
                                  (str(card), pdx))
def moves_from_spaces ( self ) : for sdx , card in enumerate ( self . spaces ) : for pdx , pile in enumerate ( self . piles ) : if not pile or card . goes_on ( pile [ - 1 ] ) : new_b = deepcopy ( self ) new_b . piles [ pdx ] . append ( new_b . spaces . pop ( sdx ) ) yield new_b , ( "Move %s from spaces down to %s" % ( card , pdx + 1 ) , DOWN_SPACES , ( str ( card ) , pdx ) )
Generate all the moves from the spaces, if any legal.
Generate all the moves from the spaces if any legal .
"""Generate all the moves from the spaces, if any legal."""
self