shenzhen-solitaire.py
def moves_to_spaces(self):
        """Generate all the moves to the spaces, if any legal."""
        if not self.num_spaces_open:
            return

        for idx, pile in enumerate(self.piles):
            if not pile:
                continue

            new_b = deepcopy(self)
            new_b.spaces.append(new_b.piles[idx].pop())
            yield new_b, ("Move %s (%s) to spaces" %
                          (self.piles[idx][-1], idx + 1), UP_SPACES, (idx))
Generate all the moves to the spaces, if any legal.
Generate all the moves to the spaces, if any legal.
Generate all the moves to the spaces if any legal .
def moves_to_spaces(self):
        if not self.num_spaces_open:
            return
        for idx, pile in enumerate(self.piles):
            if not pile:
                continue
            new_b = deepcopy(self)
            new_b.spaces.append(new_b.piles[idx].pop())
            yield new_b, ("Move %s (%s) to spaces" %
                          (self.piles[idx][-1], idx + 1), UP_SPACES, (idx))
def moves_to_spaces ( self ) : if not self . num_spaces_open : return for idx , pile in enumerate ( self . piles ) : if not pile : continue new_b = deepcopy ( self ) new_b . spaces . append ( new_b . piles [ idx ] . pop ( ) ) yield new_b , ( "Move %s (%s) to spaces" % ( self . piles [ idx ] [ - 1 ] , idx + 1 ) , UP_SPACES , ( idx ) )
Generate all the moves to the spaces, if any legal.
Generate all the moves to the spaces if any legal .
"""Generate all the moves to the spaces, if any legal."""
self