Skip to content

Commit 9bc1e8c

Browse files
committed
Add comments
1 parent 076601d commit 9bc1e8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

TicTacToe/Grid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def restartGrid(self, startingPlayer=None):
1313
self.cells = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
1414
self.currentPlayer = startingPlayer
1515
self.win = False
16-
self.movesLeft = 9
16+
self.movesLeft = 9 # Empty 3 * 3 Grid
1717
self.lastPos = None
1818

1919
def play(self, player, move):
@@ -29,6 +29,7 @@ def play(self, player, move):
2929
return self.cells
3030

3131
def setCell(self, y, x):
32+
# 3 * 3 Grid, x and y from 0 to 2
3233
if not (3 > x >= 0 and 3 > y >= 0): raise InvalidGridIndexError(y, x)
3334
if self.cells[y][x]: raise AlreadyFilledError(y, x)
3435
self.cells[y][x] = self.currentPlayer

0 commit comments

Comments
 (0)