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

Function isEmpty

src/gamesbyexample/hungryrobots.py:105–108  ·  view source on GitHub ↗

Return True if the (x, y) is empty on the board and there's also no robot there.

(x, y, board, robots)

Source from the content-addressed store, hash-verified

103
104
105def isEmpty(x, y, board, robots):
106 """Return True if the (x, y) is empty on the board and there's also
107 no robot there."""
108 return board[(x, y)] == EMPTY_SPACE and (x, y) not in robots
109
110
111def addRobots(board):

Callers 2

getRandomEmptySpaceFunction · 0.85
askForPlayerMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected