-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cell.py
23 lines (22 loc) · 1.07 KB
/
Cell.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Cell:
"""
Holds information for each cell on the board such as the letter, word/letter multiplier ect.
"""
def __init__(self, letter, letter_mul, word_mul, row, col):
self.letter = letter
self.word_mul = word_mul
self.letter_mul = letter_mul
self.centre = False
self.row = row
self.col = col
# True of the cell is adjacent to a cell with a letter in it
self.anchor = False
# The valid letters that can be placed in this cell
self.across_check = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
self.down_check = set(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'])
# If a letter is played there in this cell the additional points
# it will get from connecting to additional words
self.across_sum = 0
self.down_sum = 0