-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
45 lines (38 loc) · 932 Bytes
/
test.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
36
37
38
39
40
41
42
43
44
45
# move
# >>> cs = CoilSolver()
# >>> cs.boardX = 3
# >>> cs.boardY = 3
# >>> tempboard = np.array([[1, 0, 0],[0, 0, 0],[0, 0, 1]], int)
# >>> output = cs.move(tempboard, 1, 0, "D")
# >>> output[0]
# 1
# >>> output[1]
# 2
# >>> print(output[2])
# [[1 1 0]
# [0 1 0]
# [0 1 1]]
# can_move
# >>> cs = CoilSolver()
# >>> cs.boardX = 3
# >>> cs.boardY = 3
# >>> tempboard = np.array([[1, 0, 0],[0, 0, 0],[0, 0, 1]], int)
# >>> cs.can_move(tempboard, 1, 0)
# ['D', 'R']
# flood_fill
# >>> cs = CoilSolver()
# >>> cs.boardX = 3
# >>> cs.boardY = 3
# >>> tempboard = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]], int)
# >>> cs.flood_fill(tempboard, 2, 0)
# >>> print(tempboard)
# [[1 1 1]
# [0 1 1]
# [0 0 1]]
# solve_board_recursion
# >>> cs = CoilSolver()
# >>> cs.boardX = 3
# >>> cs.boardY = 3
# >>> tempboard = np.array([[1, 0, 0],[0, 0, 0],[0, 0, 1]], int)
# >>> cs.solve_board_recursion(tempboard, 1, 0, "")
# True, 'RDLDR'