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

Function isFull

src/gamesbyexample/fourinarow.py:119–126  ·  view source on GitHub ↗

Returns True if the `board` has no empty spaces, otherwise returns False.

(board)

Source from the content-addressed store, hash-verified

117
118
119def isFull(board):
120 """Returns True if the `board` has no empty spaces, otherwise
121 returns False."""
122 for rowIndex in range(BOARD_HEIGHT):
123 for columnIndex in range(BOARD_WIDTH):
124 if board[(columnIndex, rowIndex)] == EMPTY_SPACE:
125 return False # Found an empty space, so return False.
126 return True # All spaces are full.
127
128
129def isWinner(playerTile, board):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected