-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_puz.py
35 lines (33 loc) · 1.41 KB
/
db_puz.py
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
import numpy as np
# Initialize the puzzle with a bidimensional array of integers
puzzle_22027 = np.array([
[1, 2, 3, 4, 5, 6, 5, 0, 4, 0, 7, 8, 0],
[5, 6, 8, 0, 0, 6, 9, 8, 10, 9, 3, 5, 9],
[6, 9, 0, 11, 11, 0, 0, 5, 12, 8, 9, 12, 5],
[2, 0, 11, 3, 2, 1, 2, 12, 13, 5, 7, 9, 0],
[0, 11, 3, 2, 7, 10, 8, 7, 9, 12, 7, 5, 0],
[7, 3, 9, 5, 10, 7, 7, 2, 3, 5, 9, 0, 0],
[5, 0, 7, 10, 8, 7, 9, 14, 10, 12, 7, 2, 0],
[3, 0, 9, 7, 7, 5, 6, 2, 0, 9, 5, 3, 10],
[0, 7, 5, 7, 9, 12, 2, 0, 15, 0, 16, 9, 12],
[10, 3, 2, 5, 0, 9, 15, 7, 9, 15, 10, 12, 9],
[16, 9, 15, 15, 10, 0, 2, 3, 13, 9, 0, 17, 0],
[9, 14, 5, 10, 12, 8, 0, 10, 13, 5, 8, 2, 12],
])
# Create a dictionary to store the correspondence between numbers and letters
matches_22027 = {7: 'T', 5: 'I', 3: 'R'}
puzzle_22026 = np.array([
[1, 0, 1, 0, 2, 3, 4, 0, 2, 5, 4, 6, 3],
[6, 2, 3, 7, 7, 1, 0, 8, 5, 0, 5, 9, 10],
[3, 9, 0, 5, 0, 0, 6, 3, 4, 6, 3, 2, 1],
[0, 7, 5, 11, 8, 10, 1, 4, 4, 9, 12, 5, 0],
[7, 5, 11, 8, 2, 1, 4, 4, 5, 2, 1, 0, 8],
[9, 11, 13, 2, 3, 6, 6, 3, 2, 1, 0, 1, 2],
[0, 8, 2, 1, 4, 6, 3, 13, 9, 10, 9, 2, 1],
[8, 2, 5, 4, 4, 9, 11, 9, 0, 10, 14, 0, 7],
[15, 3, 14, 5, 9, 0, 1, 10, 11, 1, 6, 6, 9],
[0, 2, 1, 0, 0, 1, 14, 1, 3, 0, 1, 5, 4],
[6, 1, 0, 7, 3, 4, 6, 0, 2, 1, 4, 6, 9],
[5, 0, 10, 1, 14, 6, 9, 7, 7, 15, 9, 1, 0],
])
matches_22026 = {6: 'T', 9: 'I', 2: 'R', 5: 'O'}