def doMove(self, c, pos):
        """ the action is a (color, position) tuple, for the next stone to move.
        returns True if the move was legal. """
        self.movesDone += 1
        if not self.isLegal(c, pos):
            return False
        elif self._fiveRow(c, pos):
            self.winner = c
            self.b[pos] = 'x'
            return True
        else:
            tokill = self._killsWhich(c, pos)
            if self.pairsTaken[c] + len(tokill) / 2 >= 5:
                self.winner = c
                self.b[pos] = 'x'
                return True

            self._setStone(c, pos, tokill)
            if self.movesDone == (self.size[0] * self.size[1]
                                  + 2 * (self.pairsTaken[self.BLACK] + self.pairsTaken[self.WHITE])):
                # DRAW
                self.winner = self.DRAW
            return True
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/twoplayergames/pente.py/PenteGame.doMove/original