From d136063fadfeab021ce79cc81d847fd8a2853732 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 3 Dec 2016 22:56:12 +0100 Subject: Unicode improvements --- tsumego | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tsumego b/tsumego index 57c5d04..d5845d5 100755 --- a/tsumego +++ b/tsumego @@ -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" -- cgit v1.2.3