From 9a78f2918aac236918281ead094c8346a6c842b7 Mon Sep 17 00:00:00 2001
From: Anna Wiggins <annabunches@gmail.com>
Date: Sat, 14 Apr 2012 01:57:20 -0400
Subject: [PATCH] Add triangle on last move, to make long-running games easier
 to keep track of.

---
 lib/goban.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lib/goban.py b/lib/goban.py
index ed210f3..310c028 100644
--- a/lib/goban.py
+++ b/lib/goban.py
@@ -23,6 +23,7 @@ class Goban:
         self.to_move = Goban.BLACK
         self.black_captures = 0
         self.white_captures = 0
+        self.last_move = None
         self.ko = None
         self.hover = None
         self.elapsed_time = 0
@@ -54,6 +55,7 @@ class Goban:
 
         self.board[rpos] = self.to_move
         self._capture(rpos)
+        self.last_move = rpos
 
         self.to_move = self._other_color(self.to_move)
         self.clear_hover()
@@ -194,12 +196,16 @@ class Goban:
             point = self.board[pos]
 
             if point == Goban.EMPTY:
-                s = img_res[self.def_draw_codes[pos]]
+                code = self.def_draw_codes[pos]
             elif point == Goban.BLACK:
-                s = img_res['b']
+                code = 'b'
             elif point == Goban.WHITE:
-                s = img_res['w']
+                code = 'w'
+            
+            if pos == self.last_move:
+                code = code + 'T'
 
+            s = img_res[code]
             s = pygame.transform.scale(s, (inc, inc))
             ret.blit(s, ((pos % self.board_size) *inc, (pos / self.board_size) *inc))