def pack_state(self, state):
black = np.packbits(state == Board.STONE_BLACK)
white = np.packbits(state == Board.STONE_WHITE)
empty = np.packbits(state == Board.STONE_EMPTY)
image = np.concatenate((black, white, empty))
return bytes(image)
评论列表
文章目录