-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameState.py
29 lines (23 loc) · 845 Bytes
/
GameState.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from typing import NamedTuple
from numpy import ndarray
class GameState(NamedTuple):
"""
board_status: int[][]
For each element, if its absolute element is four, then
the square has been taken by a player. If element's sign
is negative, then it has been taken by player 1. Otherwise,
it has been taken by player 2.
Access: board_status[y, x]
row_status: int[][]
Represent the horizontal line mark status: 1 for marked, 0 for not.
Access: row_status[y, x]
col_status: int[][]
Represent the vertical line mark status: 1 for marked, 0 for not.
Access: col_status[y, x]
player1_turn: bool
True if it is player 1 turn, False for player 2.
"""
board_status: ndarray
row_status: ndarray
col_status: ndarray
player1_turn: bool