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

Function row_win

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

Check if player has a complete row.

(board: np.ndarray, player: int)

Source from the content-addressed store, hash-verified

47
48
49def row_win(board: np.ndarray, player: int) -> bool:
50 """Check if player has a complete row."""
51 return any(all(board[x, y] == player for y in range(3)) for x in range(3))
52
53
54def col_win(board: np.ndarray, player: int) -> bool:

Callers 1

evaluateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected