MCPcopy Create free account
hub / github.com/geekcomputers/Python / possibilities

Function possibilities

Tic-Tac-Toe Games/tic-tac-toe4.py:36–38  ·  view source on GitHub ↗

Return list of empty positions on the board.

(board: np.ndarray)

Source from the content-addressed store, hash-verified

34
35
36def possibilities(board: np.ndarray) -> List[Tuple[int, int]]:
37 """Return list of empty positions on the board."""
38 return [(i, j) for i in range(3) for j in range(3) if board[i, j] == 0]
39
40
41def random_place(board: np.ndarray, player: int) -> np.ndarray:

Callers 1

random_placeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected