22b (slow!)
This commit is contained in:
parent
4abc996e0f
commit
8afce8afa3
|
@ -66,3 +66,18 @@ dprint(supporting)
|
|||
ic(supporters)
|
||||
print(sum(1 for k, v in supporting.items() if \
|
||||
all(supporters[vv] > 1 for vv in v)))
|
||||
|
||||
# part 2. basically just repeat the first part of part 1.
|
||||
all_grounded = grounded
|
||||
total = 0
|
||||
for i, g in enumerate(all_grounded):
|
||||
if i == 0: # our own fake box
|
||||
continue
|
||||
grounded = np.asarray([(-666, -666, 0, 666, 666, 1)])
|
||||
moving = np.append(all_grounded[1:i], all_grounded[i+1:], axis=0)
|
||||
gtree = index.Index(properties=index.Property(dimension=3))
|
||||
gtree.insert(0, grounded[0])
|
||||
assign_touching_ground_to_ground()
|
||||
ic(i, len(moving))
|
||||
total += len(moving)
|
||||
print(total)
|
||||
|
|
Loading…
Reference in New Issue