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

Function col_win

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

Check if player has a complete column.

(board: np.ndarray, player: int)

Source from the content-addressed store, hash-verified

52
53
54def col_win(board: np.ndarray, player: int) -> bool:
55 """Check if player has a complete column."""
56 return any(all(board[y, x] == player for y in range(3)) for x in range(3))
57
58
59def diag_win(board: np.ndarray, player: int) -> bool:

Callers 1

evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected