MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / getBoardWithValidMoves

Function getBoardWithValidMoves

src/gamesbyexample/reversegam.py:143–149  ·  view source on GitHub ↗

Returns a new board with . marking the possible moves.

(board, tile)

Source from the content-addressed store, hash-verified

141
142
143def getBoardWithValidMoves(board, tile):
144 """Returns a new board with . marking the possible moves."""
145 duplicateBoard = copy.copy(board)
146
147 for x, y in getValidMoves(duplicateBoard, tile):
148 duplicateBoard[(x, y)] = '.'
149 return duplicateBoard
150
151
152def displayBoard(board):

Callers 1

mainFunction · 0.70

Calls 1

getValidMovesFunction · 0.70

Tested by

no test coverage detected