Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/gogame.py
diff options
context:
space:
mode:
authorZach Stephens <zxs3926@rit.edu>2011-05-20 16:02:59 (GMT)
committer Zach Stephens <zxs3926@rit.edu>2011-05-20 16:02:59 (GMT)
commit76f1481b3b12c725a28eacc61d9ff35ac8f42c2d (patch)
treef2b82d81961de79173a0effab33674927acfc316 /gogame.py
parent3bf559404826b29a76f4dfb87286a7e66b2b4a8f (diff)
Occupied pieces with editing marks have been added. Toolbar buttons changed to make the editor be more connected to the game than independent. Board widget modified to add the new pixel buffers, gogame modified to ignore editing pieces, and activity modified to make the basics of the editor work.HEADmaster
Diffstat (limited to 'gogame.py')
-rw-r--r--gogame.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/gogame.py b/gogame.py
index ce674f2..acc1921 100644
--- a/gogame.py
+++ b/gogame.py
@@ -135,7 +135,16 @@ class GoGame:
def illegal(self, x, y, color):
""" Check if a play by color at pos would be an illigal move, and return pretty errors"""
if self.status.has_key((x, y)):
- return _('There already is a stone there!')
+ if self.status[(x,y)] == 'X':
+ del self.status[(x,y)]
+ elif self.status[(x,y)] == 'T':
+ del self.status[(x,y)]
+ elif self.status[(x,y)] == 'C':
+ del self.status[(x,y)]
+ elif self.status[(x,y)] == 'S':
+ del self.status[(x,y)]
+ else:
+ return _('There already is a stone there!')
if self.checkKo((x, y), color):
return _('Ko violation!')
@@ -175,6 +184,8 @@ class GoGame:
for y in self.neighbors(x):
if not self.status.has_key(y) and y != exc and y != pos: # found a liberty
return []
+ elif self.status.has_key(y) and (self.status[y] == 'X' or self.status[y] == 'C' or self.status[y] == 'T' or self.status[y] == 'S'):
+ return []
elif self.status.has_key(y) and self.status[y]==color \
and not y in newlyFound and not y in st: # found another stone of same color
n.append(y)