-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTODO-solver.txt
104 lines (41 loc) · 1.49 KB
/
TODO-solver.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
interference graph
make sure there are no leaves,
starting from winning, make a graph of what interferes with paths
make sure everything is in a loop
using trove for long sets and maps
switch exclusively to packed-car notation
investigate using bitset
bitset probably isn't going to work
can't figure out how to really compress the boards, always taking up about 64 bits for 8 cars
memoize each row!
probably won't work either
need to prune dead ends
look at simply 2 2car 1 3car or something, and see how the easier branches are different than the ultimately hardest branch
visualize
determine 1 move away from clear path?
partition based on invariants
right now, 14 cars seems to suffice to 6x6 board
if ever generalized and need more bits for cars:
only use ABCD in configs to encode cars
rely on 4 color theorem
scan through to find second occurrence of A car, then that is car#5
this gets around the current limitation of only 14 cars
so will never need more than 4 bits for each coor of board, so 4x6x6 = 18 bytes maximum for any number of cars
can use 1 byte per car, so up to 18 cars, use packed-car notation
no garbage collection
audit all for loops
create a level database:
rows by cols, j?, k?, #2cars, #3cars
level generator
rows
cols
exit
# of 2cars
# of 3cars
placement of cars
j joints?
k joints?
joints cannot be next to each other (vertices touch)
matching joints must be on neighbring sides
joints cannot be on side of exit
loops? loops are fine