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

Function isBoardFull

src/gamesbyexample/gomoku.py:184–192  ·  view source on GitHub ↗

Returns True if the board is full of tiles, otherwise, returns False if there is an empty space somewhere on the board.

(board)

Source from the content-addressed store, hash-verified

182
183
184def isBoardFull(board):
185 """Returns True if the board is full of tiles, otherwise, returns
186 False if there is an empty space somewhere on the board."""
187 for x in range(BOARD_WIDTH):
188 for y in range(BOARD_HEIGHT):
189 if board[(x, y)] == EMPTY_SPACE:
190 # An empty space means the board is not full.
191 return False
192 return True # None of the spaces were empty, so the board is full.
193
194
195# If the program is run (instead of imported), run the game:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected