forked from reingart/exercism
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgo_counting.py
39 lines (30 loc) · 1.03 KB
/
go_counting.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
30
31
32
33
34
35
36
37
38
39
class Board:
"""Count territories of each player in a Go game
Args:
board (list[str]): A two-dimensional Go board
"""
def __init__(self, board):
pass
def territory(self, x, y):
"""Find the owner and the territories given a coordinate on
the board
Args:
x (int): Column on the board
y (int): Row on the board
Returns:
(str, set): A tuple, the first element being the owner
of that area. One of "W", "B", "". The
second being a set of coordinates, representing
the owner's territories.
"""
pass
def territories(self):
"""Find the owners and the territories of the whole board
Args:
none
Returns:
dict(str, set): A dictionary whose key being the owner
, i.e. "W", "B", "". The value being a set
of coordinates owned by the owner.
"""
pass