Logo Search packages:      
Sourcecode: uligo version File versions  Download package

def board1::Board::undo (   self,
  no = 1,
  changeCurrentColor = 1 

Undo the last no moves. 

Definition at line 528 of file board1.py.

00528                                               :
        """ Undo the last no moves. """

        for i in range(no):
            if self.undostack:
                pos, color, captures = self.undostack.pop()
                if self.status.has_key(pos):
                    del self.status[pos]
                    del self.stones[pos]
                for p in captures:
                    self.placeStone(p, self.invert(color)) 
                    self.status[p] = self.invert(color)
                # self.update_idletasks()
                if changeCurrentColor:
                    self.currentColor = self.invert(self.currentColor)

    def clear(self):

Generated by  Doxygen 1.6.0   Back to index