-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpuzzle16x16.py
More file actions
47 lines (43 loc) · 1.38 KB
/
puzzle16x16.py
File metadata and controls
47 lines (43 loc) · 1.38 KB
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
37
38
39
40
41
42
43
44
45
46
47
from puzzle import Puzzle
from cell import Cell
class Puzzle16x16(Puzzle):
def __init__(self):
super(Puzzle16x16, self).__init__()
self.size = 16
def create_cell(self, row, col, value):
possible_values = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
cell = Cell(row, col, value, possible_values)
if row <= 3 and col <= 3:
cell.section = 0
elif row <= 3 and col <= 7:
cell.section = 1
elif row <= 3 and col <= 11:
cell.section = 2
elif row <= 3 and col <= 15:
cell.section = 3
elif row <= 7 and col <= 3:
cell.section = 4
elif row <= 7 and col <= 7:
cell.section = 5
elif row <= 7 and col <= 11:
cell.section = 6
elif row <= 7 and col <= 15:
cell.section = 7
elif row <= 11 and col <= 3:
cell.section = 8
elif row <= 11 and col <= 7:
cell.section = 9
elif row <= 11 and col <= 11:
cell.section = 10
elif row <= 11 and col <= 15:
cell.section = 11
elif col <= 3:
cell.section = 12
elif col <= 7:
cell.section = 13
elif col <= 11:
cell.section = 14
else:
cell.section = 15
cell.index = str(row) + ':' + str(col)
self.cell_list.append(cell)