Get the board to print
This commit is contained in:
parent
f596e0f3ee
commit
824bf6c889
2 changed files with 46 additions and 6 deletions
22
lib/goban.py
22
lib/goban.py
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue