1 from collections
import namedtuple
3 PLAYER_COLOR_WHITE
= 'W'
4 PLAYER_COLOR_BLACK
= 'B'
6 PLAYER_COLORS
= ( PLAYER_COLOR_BLACK
, PLAYER_COLOR_WHITE
)
8 class BlackWhite(namedtuple('BlackWhite', 'black white')):
10 return BlackWhite(*map( f
, self
))
12 def map_pathway(self
, func_list
):
18 def the_other_color(color
):
19 if color
== PLAYER_COLOR_BLACK
:
20 return PLAYER_COLOR_WHITE
21 return PLAYER_COLOR_BLACK