diff --git a/src/go.py b/src/go.py --- a/src/go.py +++ b/src/go.py @@ -1,13 +1,9 @@ import logging as log +from util import EMPTY,BLACK,WHITE,colorNames from gamerecord import GameRecord -EMPTY=0 -BLACK=1 -WHITE=-1 - - class Go: ## Initializes self.board to a list[r][c]=EMPTY. def __init__(self,boardSize=19): @@ -24,7 +20,7 @@ class Go: # @param color BLACK or WHITE # @return True on success, False on failure (illegal move) def move(self,color,row,col): - if color!=self.toMove: log.warning("move by %s out of order",color) + if color!=self.toMove: log.warning("move by %s out of order",colorNames[color]) if self.board[row][col]!=EMPTY: return False self.board[row][col]=color