39 lines
1.0 KiB
Python
39 lines
1.0 KiB
Python
|
|
|
||
|
|
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 territoryFor(self, coord):
|
||
|
|
"""Find the owner and the territories given a coordinate on
|
||
|
|
the board
|
||
|
|
|
||
|
|
Args:
|
||
|
|
coord ((int,int)): Coordinate 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
|