diff options
-rwxr-xr-x | tsumego | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -14,24 +14,29 @@ class Board: ye = 19 to_play = "B" finished = False + last_move = "" def to_move(self): if self.to_play == "B": - return "◯" - return "⬤" + return "\u25ef" + return "\u2b24" def board_symbol(self, x, y): + if x+y == self.last_move: + pre = "" + else: + pre = "" if x+y in self.board: if self.board[x+y] == "W": if x=="a": - return " ⬤ " + return " "+pre+"\u2b24 " else: - return "─⬤ " + return "─"+pre+"\u2b24 " if self.board[x+y] == "B": if x=="a": - return " ◯ " + return " "+pre+"\u25ef " else: - return "─◯ " + return "─"+pre+"\u25ef " if (y=="d") or (y=="p") or (y=="j"): if (x=="d") or (x=="p") or (x=="j"): return "─*─" @@ -109,11 +114,13 @@ class Board: self.board[pos] = "B" self.process_captures("W") self.to_play = "W" + self.last_move = pos if key == "W": for pos in val: self.board[pos] = "W" self.process_captures("B") self.to_play = "B" + self.last_move = pos if key == "PL": if val[0] == "1" or val[0] == "b" or val[0] == "B": self.to_play = "B" |