Fork me on GitHub
#adventofcode
<
2019-12-19
>
fellshard08:12:37

I'm an idiot and made today's far harder for myself on accident

4
fellshard08:12:10

Then I went to describe the logic in a comment and realized I could have done things a chunk faster and far earlier, and with far easier to follow logic. Ah well.

fellshard08:12:43

Now the solution is practically instant. Heh.

fellshard08:12:26

Dropping this here just to show how convoluted it was.

fellshard08:12:44

tl;dr, I was tracing the top and the bottom, thinking I needed to check the bounds from an earlier bad assumption about what was needed to solve the problem.

fellshard08:12:02

Also goofed: I ran it first time for a ship of size 1000, not 100; amazingly, it completed without taking too long.

misha10:12:57

how instant is "practically instant"?

fellshard16:12:38

2.5s (measured by hand, w/o benchmark)

fellshard16:12:06

Compared to... maybe 10-20s the other way?

uneman17:12:01

i tried to get tangents of both edges then find the corner with simple math. but no luck because errors were so significant...

😅 4
misha21:12:15

went with trigonometry at first too, but was too imprecise.

rjray21:12:17

I am still hitting a brick wall on day 18. Nothing I do to my code is reducing the search-space enough.

rjray21:12:22

At this point, my code is so long and convoluted I'm tempted to start over from square 0.

misha21:12:35

same here, lest 1 cache idea for tomorrow. Already have like 500 lines of code for different bfs/dfs/a*/dj combinations harold

uneman03:12:53

um, dj means dijkstra?

😅 4
misha21:12:36

which solve samples with times like: 2,7,7,∞,30 msec kappa

misha21:12:15

and even if you do find 1 path early - still need to +- exhaust the rest of the space "just in case"