summaryrefslogtreecommitdiff
path: root/tictactoe.py
diff options
context:
space:
mode:
Diffstat (limited to 'tictactoe.py')
-rwxr-xr-xtictactoe.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tictactoe.py b/tictactoe.py
index 12e6c25..e313a82 100755
--- a/tictactoe.py
+++ b/tictactoe.py
@@ -191,6 +191,18 @@ class gtkTicTacToe (gtk.DrawingArea):
and not self._map[0][i]:
self._map[0][i] = COMPUTER_ID
return
+ if not self._map[0][0]:
+ self._map[0][0] = COMPUTER_ID
+ return
+ elif not self._map[0][2]:
+ self._map[0][2] = COMPUTER_ID
+ return
+ elif not self._map[2][2]:
+ self._map[2][2] = COMPUTER_ID
+ return
+ elif not self._map[2][0]:
+ self._map[2][0] = COMPUTER_ID
+ return
cells = self.empty_cells ()
cell = random.randint (1, cells)
for j in range (3):