-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcell.py
More file actions
36 lines (31 loc) · 733 Bytes
/
cell.py
File metadata and controls
36 lines (31 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CLEARED_CELL = -1
#Text based cells
def cellIsFilled(cell):
return cell != CLEARED_CELL
#def cellCollides(cell1, cell2):
# return cellIsFilled(cell1) and cellIsFilled(cell2)
#Class based cells
# class Cell():
#
# def __init__(self):
# self.filled = False
# self.type = "X"
#
# def simpleCopy(self):
# cell = Cell()
# if self.filled:
# cell.fillWithType(self.type)
# return cell
#
# def fill(self):
# self.filled = True
#
# def fillWithType(self, type):
# self.type = type
# self.fill()
#
# def clear(self):
# self.filled = False
#
# def collides(self, otherCell):
# return self.filled and otherCell.filled