Get the board to print

This commit is contained in:
2012-04-17 18:07:04 -04:00
parent f596e0f3ee
commit 824bf6c889
2 changed files with 46 additions and 6 deletions

View File

@ -258,6 +258,28 @@ class Goban:
return num_deleted
def draw_code(self, pos):
if not self._on_board(pos):
return None
point = self.board[pos]
if point == Goban.EMPTY:
code = self.def_draw_codes[pos]
elif point == Goban.BLACK:
code = 'b'
elif point == Goban.WHITE:
code = 'w'
if pos == self.last_move:
code = code + 'T'
if pos == self.ko:
code = code + 'C'
return code
# def draw_board(self, size, img_res):
# ret = pygame.Surface((size,size))