Commit Graph

85 Commits (main)

Author SHA1 Message Date
magical d84cac47a0 day 25 solution 2023-12-27 07:43:40 +00:00
magical 318adbd307 day 24 part 1 2023-12-24 05:56:48 +00:00
magical a940dff830 day 21 cleanup 2023-12-24 04:51:38 +00:00
magical c5d4f796e0 day 21 part 2 solve!
this is messy because i went in like three unsuccessful directions
before hitting on an approach that worked
2023-12-24 03:24:35 +00:00
magical d3d175a038 day 23 cleanup part 1 2023-12-23 08:36:14 +00:00
magical 7c2e376938 day 23 part 2 2023-12-23 07:30:37 +00:00
magical 219cde7d0a day 23 part 1 2023-12-23 06:04:49 +00:00
magical c291508b82 no turning back 2023-12-22 09:16:15 +00:00
magical dae0597628 day 20 part 2 answer 2023-12-22 09:11:41 +00:00
magical fd8de9c7c2 ignore more samples 2023-12-22 09:00:58 +00:00
magical 3dff6a2247 day 22 cleanup 2023-12-22 08:54:07 +00:00
magical efd7f887b8 day 22 part 2 2023-12-22 06:47:19 +00:00
magical 2635e69315 day 22 optimization 2023-12-22 06:27:36 +00:00
magical f805d9d373 day 22 part 1 2023-12-22 06:23:52 +00:00
magical 52a2184a3c day 21 part 1 2023-12-21 05:20:42 +00:00
magical f3b38a3ece day 20 part 2, sorta
finish this up later
2023-12-21 05:02:12 +00:00
magical 7178a11eee day 20 part 2 attempt
i don't think brute force is going to work
2023-12-20 06:03:08 +00:00
magical 9165dd7d86 day 20 part 1 2023-12-20 06:02:43 +00:00
magical 61c44b283c day 19 cleanup 2023-12-19 07:06:29 +00:00
magical 7b51d4b8dd day 19 part 2 2023-12-19 06:38:56 +00:00
magical b95527ad1d day 19 part 1 2023-12-19 05:31:27 +00:00
magical 6704766eba use dict for 'visit' var in day 16
not sure if this is an improvement? it's more or less the same
as the array version
2023-12-19 04:57:53 +00:00
magical ef2711b76f prelude: add ltranspose 2023-12-19 04:54:36 +00:00
magical 7baf6aa596 prelude: add lextract 2023-12-19 04:50:01 +00:00
magical 89dcdeb553 prelude: add an example for transform 2023-12-19 04:49:17 +00:00
magical 3faf36c645 ignore extra samples 2023-12-18 06:40:01 +00:00
magical 578f6e87ac day 18 part 2 2023-12-18 06:37:56 +00:00
magical bf4e88d66f day 18 part 1 2023-12-18 05:20:25 +00:00
magical fe76e83e98 day 17 fix cost calculation
i was accidentally using the previous coordinates to calculate the cost
for each node, which means the A* search was effectively calculating the
cost of the return trip instead of the forward path.
doesn't affect the path at all - the start and end nodes are fixed, so
it doesn't matter whether their costs are included or not - but it does
mean that the cost being returned at the end was off by ((value at end
point) - (value at start point)) compared to the expected value.
2023-12-17 06:42:34 +00:00
magical 14ef33326e day 17 solution
there's a small bug in the cost calculation which will be fixed in the
next commit
2023-12-17 06:26:31 +00:00
magical 539cf753d0 day 16 cleanup
switch to globals (passing array names around is ugly).
(maybe look into dicts sometime?)

also, properly detect width/height from the input
instead of hardcoding it
2023-12-17 06:24:26 +00:00
magical c592761d00 day 15 use dicts
tcl's dict type is exactly what we need for this problem:
an order-preserving de-duplicated list of key-value pairs.
2023-12-16 06:57:12 +00:00
magical 94bf752568 day 16 part 2 2023-12-16 06:02:16 +00:00
magical b14209ff39 day 16 part 1 2023-12-16 05:43:57 +00:00
magical f638ffbff7 day 15 solution 2023-12-15 06:11:06 +00:00
magical 5ad3c05219 day 14 part 2 2023-12-14 09:46:06 +00:00
magical cf548cb740 day 14 part 1 2023-12-14 09:45:13 +00:00
magical 632022d073 add more helpers
llen and slen to get the length of a list or string.
trim, replace and splitstr for common string operations.
2023-12-13 07:13:37 +00:00
magical b99ad03de5 day 13 part 2 2023-12-13 06:04:18 +00:00
magical 918d64f258 day 13 part 1 2023-12-13 05:44:49 +00:00
magical c55423d6f3 day 12 cleanup 2023-12-12 09:41:08 +00:00
magical 99405e2ad0 day 12 solution 2023-12-12 09:27:06 +00:00
magical e8a6d55fa8 day 11 part 2 2023-12-12 04:56:27 +00:00
magical b7062a7801 day 11 part 1 2023-12-11 05:31:14 +00:00
magical 55158903e6 day 10 much faster fill with numpy 2023-12-10 07:39:06 +00:00
magical 3b5b9f3839 day 10 more efficient fill
i also tried getting rid of the 'next' dict and just keeping track of a
boolean of whether we changed anything on each pass, but that made it
slower somehow. cache effects i guess?
2023-12-10 07:03:54 +00:00
magical 3ba6804013 day 10 cleanup, make fill slighly more efficient 2023-12-10 06:43:32 +00:00
magical c111075e16 day 10 part 2 2023-12-10 06:30:14 +00:00
magical a395a39fac day 10 part 1 2023-12-10 05:35:54 +00:00
magical 395ad666c8 fix lmul 2023-12-09 07:16:10 +00:00