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

Method _move

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

Source from the content-addressed store, hash-verified

46
47 # to move the pieces
48 def _move(self, row, col):
49 piece = self.board.get_piece(row, col)
50 if (self.select) and (piece == 0) and (row, col) in self.valid_moves:
51 self.board.move(self.select, row, col)
52 skip = self.valid_moves[(row, col)]
53 if skip:
54 self.board.remove(skip)
55 self.chg_turn()
56 else:
57 return False
58 return True
59
60 # to draw next possible move
61 def draw_moves(self, moves):

Callers 1

selectrcMethod · 0.95

Calls 4

chg_turnMethod · 0.95
get_pieceMethod · 0.80
moveMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected