22b (slow!)

This commit is contained in:
basicbonobo 2023-12-26 16:53:42 +01:00
parent 4abc996e0f
commit 8afce8afa3
1 changed files with 15 additions and 0 deletions

View File

@ -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)