def execute_once(self, swap=None,
                     spell_changes=None, spell_destructions=None,
                     random_fill=False):
        """Execute the board only one time. Do not execute chain reactions.

        Arguments:
        swap - pair of adjacent positions
        spell_changes - sequence of (position, tile) changes
        spell_destructions - sequence of positions to be destroyed

        Return: (copy of the board, destroyed tile groups)
        """
        bcopy = self.copy()  # work with a copy, not self
        total_destroyed_tile_groups = list()
        # swap if any
        bcopy._swap(swap)
        # spell changes if any
        bcopy._change(spell_changes)
        # spell destructions and record if any
        # first convert simple positions to groups
        spell_destructions = spell_destructions or tuple()
        destruction_groups = [[p] for p in spell_destructions]
        destroyed_tile_groups = bcopy._destroy(destruction_groups)
        total_destroyed_tile_groups.extend(destroyed_tile_groups)
        # execute one time only
        # look for matched groups
        matched_position_groups = bcopy._match()
        # destroy and record matched groups
        destroyed_tile_groups = bcopy._destroy(matched_position_groups)
        total_destroyed_tile_groups.extend(destroyed_tile_groups)
        bcopy._fall()
        if random_fill:
            bcopy._random_fill()
        return bcopy, total_destroyed_tile_groups
def execute_once ( self , swap = None , spell_changes = None , spell_destructions = None , random_fill = False ) : bcopy = self . copy ( ) total_destroyed_tile_groups = list ( ) bcopy . _swap ( swap ) bcopy . _change ( spell_changes ) spell_destructions = spell_destructions or tuple ( ) destruction_groups = [ [ p ] for p in spell_destructions ] destroyed_tile_groups = bcopy . _destroy ( destruction_groups ) total_destroyed_tile_groups . extend ( destroyed_tile_groups ) matched_position_groups = bcopy . _match ( ) destroyed_tile_groups = bcopy . _destroy ( matched_position_groups ) total_destroyed_tile_groups . extend ( destroyed_tile_groups ) bcopy . _fall ( ) if random_fill : bcopy . _random_fill ( ) return bcopy , total_destroyed_tile_groups
Execute the board only one time. Do not execute chain reactions.

        Arguments:
        swap - pair of adjacent positions
        spell_changes - sequence of (position, tile) changes
        spell_destructions - sequence of positions to be destroyed

        Return: (copy of the board, destroyed tile groups)