MCPcopy Create free account
hub / github.com/geekcomputers/Python / selectrc

Method selectrc

Checker_game_by_dz/modules/checker.py:34–45  ·  view source on GitHub ↗
(self, row, col)

Source from the content-addressed store, hash-verified

32
33 # select row and column
34 def selectrc(self, row, col):
35 if self.select:
36 result = self._move(row, col)
37 if not result:
38 self.select = None
39
40 piece = self.board.get_piece(row, col)
41 if (piece != 0) and (piece.color == self.turn):
42 self.select = piece
43 self.valid_moves = self.board.get_valid_moves(piece)
44 return True
45 return False
46
47 # to move the pieces
48 def _move(self, row, col):

Callers 1

first.pyFile · 0.80

Calls 3

_moveMethod · 0.95
get_pieceMethod · 0.80
get_valid_movesMethod · 0.80

Tested by

no test coverage detected