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

Function isValidSpace

src/gamesbyexample/tictactoe.py:65–68  ·  view source on GitHub ↗

Returns True if the space on the board is a valid space number and the space is blank.

(board, space)

Source from the content-addressed store, hash-verified

63 board['7'], board['8'], board['9'])
64
65def isValidSpace(board, space):
66 """Returns True if the space on the board is a valid space number
67 and the space is blank."""
68 return space in ALL_SPACES and board[space] == BLANK
69
70
71def isWinner(board, player):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected