MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / move

Method move

projects/Chess/main.py:629–639  ·  view source on GitHub ↗
(self, x1, y1, x2, y2)

Source from the content-addressed store, hash-verified

627 return grid[i][j] == 0 or grid[i][j].islower()
628
629 def move(self, x1, y1, x2, y2):
630 global grid, validMoves
631 validMoveGen.generateValidMoves(x1, y1, grid)
632 for i in range(len(validMoves)):
633 if validMoves[i][0] == x2 and validMoves[i][1] == y2:
634 grid[x2][y2] = grid[x1][y1]
635 grid[x1][y1] = 0
636 self.turn *= -1
637 break
638 board.placePieces()
639 board.resetColor()
640
641
642eventHandler = Event()

Callers 5

eventMethod · 0.95
mainFunction · 0.45
fillGapsFunction · 0.45
insertGapsFunction · 0.45
organize_directoryFunction · 0.45

Calls 3

generateValidMovesMethod · 0.80
placePiecesMethod · 0.80
resetColorMethod · 0.80

Tested by

no test coverage detected