1 """Imago output module."""
5 COORDS = 'abcdefghijklmnopqrs'
8 """Converts textual represantation to SGF (set position)."""
10 board = sys.stdin.read().split('\n')
11 board = [line.split() for line in board]
18 if board[i][j] == 'B':
20 elif board[i][j] == 'W':
24 #TODO version numbering
25 sgf += "(;FF[4]GM[1]SZ[19]AP[Imago:0.1.0]"
26 sgf += "AB" + ''.join('[' + coords[j] + coords[i] + ']' for (i, j) in black)
27 sgf += "AW" + ''.join('[' + coords[j] + coords[i] + ']' for (i, j) in white)
31 def __init__(self, size, stones):
38 for i in range(self.size):
40 for j in range(self.size):
41 line.append(self.stones[k])
43 lines.append(" ".join(line))
44 return ("\n".join(lines))
49 def __init__(self, size):
50 self.board = (size * size) * "."