chiark / gitweb /
aoc-2022.git
11 months ago22a input parsed
Ben Harris [Sat, 1 Jun 2024 09:29:40 +0000 (10:29 +0100)]
22a input parsed

11 months ago21b done
Ben Harris [Fri, 31 May 2024 21:05:43 +0000 (22:05 +0100)]
21b done

11 months ago21b that does something useful
Ben Harris [Fri, 31 May 2024 18:52:00 +0000 (19:52 +0100)]
21b that does something useful

It constructs a function to evaluate the result, so then we can make
it depend on the human's number.

11 months ago21a: pull out opcode decoding
Ben Harris [Fri, 31 May 2024 13:01:24 +0000 (14:01 +0100)]
21a: pull out opcode decoding

11 months ago21a simplified
Ben Harris [Fri, 31 May 2024 12:52:20 +0000 (13:52 +0100)]
21a simplified

Less cleverness, more flexibility for 21b

11 months ago21a done
Ben Harris [Fri, 31 May 2024 08:59:11 +0000 (09:59 +0100)]
21a done

11 months ago20b done
Ben Harris [Fri, 31 May 2024 08:13:15 +0000 (09:13 +0100)]
20b done

The problem was that my input included repeated numbers, so I needed to
keep track of which instance of a repeated number I was moving.  I
achieved this by applying the mixing operation to a list of indices into
the original array, looking up shift amounts in the original array and
translating back to the original values at the end.

11 months ago20: trivial simplification
Ben Harris [Thu, 30 May 2024 20:25:29 +0000 (21:25 +0100)]
20: trivial simplification

11 months ago20b: working on the example
Ben Harris [Thu, 30 May 2024 20:24:19 +0000 (21:24 +0100)]
20b: working on the example

But not the real input

11 months ago20a done
Ben Harris [Thu, 30 May 2024 19:45:16 +0000 (20:45 +0100)]
20a done

Thanks to cardboard Verity for providing the answer, which is that it
doesn't matter where the start of the list is: everything treats it as
circular.

11 months ago20a: slight simplification
Ben Harris [Thu, 30 May 2024 13:38:42 +0000 (14:38 +0100)]
20a: slight simplification

11 months ago20a example OK
Ben Harris [Thu, 30 May 2024 13:32:51 +0000 (14:32 +0100)]
20a example OK

Fails on the real input though.

11 months ago20a closer
Ben Harris [Wed, 29 May 2024 12:59:41 +0000 (13:59 +0100)]
20a closer

Now the only problem is when a number lands precisely on the boundary.

11 months ago20a doesn't work
Ben Harris [Wed, 29 May 2024 09:37:48 +0000 (10:37 +0100)]
20a doesn't work

It's a pretty solution, but the problem statement has different ideas
about what moving an element past the end of the list means.

11 months ago19a even faster
Ben Harris [Tue, 28 May 2024 08:26:34 +0000 (09:26 +0100)]
19a even faster

Merging the two "is it worth it?" checks.

11 months ago19a: much faster
Ben Harris [Tue, 28 May 2024 08:17:30 +0000 (09:17 +0100)]
19a: much faster

We now don't build a robot if our production rate of it resource is
enough to build a new robot of the most expensive kind every minute.

11 months ago19a: correct maximum-cost calculation
Ben Harris [Mon, 27 May 2024 13:16:38 +0000 (14:16 +0100)]
19a: correct maximum-cost calculation

11 months ago19a done
Ben Harris [Mon, 27 May 2024 12:51:44 +0000 (13:51 +0100)]
19a done

11 months ago19a gets the example blueprint 1 right
Ben Harris [Mon, 27 May 2024 10:40:14 +0000 (11:40 +0100)]
19a gets the example blueprint 1 right

Takes 17.8 seconds to do so.

11 months ago19a: this approach almost works
Ben Harris [Mon, 27 May 2024 10:00:03 +0000 (11:00 +0100)]
19a: this approach almost works

But not close enough to continue with it.

11 months ago19b done
Ben Harris [Sun, 26 May 2024 13:26:54 +0000 (14:26 +0100)]
19b done

11 months ago16a: use fact that ⍟ can take an array of repetition counts
Ben Harris [Sun, 26 May 2024 07:24:11 +0000 (08:24 +0100)]
16a: use fact that ⍟ can take an array of repetition counts

11 months ago18a: comment correction
Ben Harris [Sat, 25 May 2024 23:12:29 +0000 (00:12 +0100)]
18a: comment correction

11 months ago18a done
Ben Harris [Sat, 25 May 2024 23:09:14 +0000 (00:09 +0100)]
18a done

11 months ago17b finally done
Ben Harris [Sat, 25 May 2024 22:35:24 +0000 (23:35 +0100)]
17b finally done

I got confused and forgot that jets didn't reset for each rock.  Once
that was fixed it was only a bit slow.

11 months ago17b works on example
Ben Harris [Sat, 25 May 2024 21:22:22 +0000 (22:22 +0100)]
17b works on example

11 months ago17a done
Ben Harris [Sat, 25 May 2024 10:15:20 +0000 (11:15 +0100)]
17a done

11 months ago17a starting to work
Ben Harris [Tue, 21 May 2024 21:10:06 +0000 (22:10 +0100)]
17a starting to work

need to not restart jet sequence for each rock, though

11 months ago16b done
Ben Harris [Tue, 21 May 2024 19:10:31 +0000 (21:10 +0200)]
16b done

A little light memoization did the trick (but 27s CPU time!)

11 months ago16a done
Ben Harris [Tue, 21 May 2024 15:36:56 +0000 (17:36 +0200)]
16a done

11 months ago16a: example completes in reasonable time
Ben Harris [Tue, 21 May 2024 15:24:55 +0000 (17:24 +0200)]
16a: example completes in reasonable time

11 months ago16a: faster search, now 19 levels in a minute
Ben Harris [Tue, 21 May 2024 11:00:36 +0000 (13:00 +0200)]
16a: faster search, now 19 levels in a minute

11 months ago16a: correct but slow exhaustive search
Ben Harris [Tue, 21 May 2024 10:38:32 +0000 (12:38 +0200)]
16a: correct but slow exhaustive search

11 months ago15b done
Ben Harris [Tue, 21 May 2024 09:08:29 +0000 (11:08 +0200)]
15b done

Utter mess with lots of debugging, which I've left in for posterity.

11 months ago15b: found constraining beacons
Ben Harris [Wed, 15 May 2024 15:53:02 +0000 (17:53 +0200)]
15b: found constraining beacons

11 months ago15a done
Ben Harris [Wed, 15 May 2024 14:45:39 +0000 (15:45 +0100)]
15a done

11 months ago15a: input parsing
Ben Harris [Wed, 15 May 2024 10:34:46 +0000 (11:34 +0100)]
15a: input parsing

11 months ago14b done
Ben Harris [Tue, 14 May 2024 16:19:58 +0000 (17:19 +0100)]
14b done

I dodged the bug by sticking the floor on by simpler means.

11 months ago14b kind of works but gives weird internal CBQN errors
Ben Harris [Tue, 14 May 2024 15:12:30 +0000 (16:12 +0100)]
14b kind of works but gives weird internal CBQN errors

11 months ago14a done
Ben Harris [Tue, 14 May 2024 14:58:00 +0000 (15:58 +0100)]
14a done

11 months ago14a: map constructed
Ben Harris [Tue, 14 May 2024 12:16:38 +0000 (13:16 +0100)]
14a: map constructed

11 months ago14a: short-circuit boolean ops because I think I'll need them
Ben Harris [Tue, 14 May 2024 06:45:01 +0000 (07:45 +0100)]
14a: short-circuit boolean ops because I think I'll need them

11 months ago13b done
Ben Harris [Mon, 13 May 2024 20:03:39 +0000 (21:03 +0100)]
13b done

11 months ago13a working on the example but probably subtly wrong
Ben Harris [Mon, 13 May 2024 19:43:28 +0000 (20:43 +0100)]
13a working on the example but probably subtly wrong

11 months ago13a: most of the list parser done
Ben Harris [Mon, 13 May 2024 13:33:52 +0000 (14:33 +0100)]
13a: most of the list parser done

11 months ago12: factorise contruction of can_go_x arrays somewhat
Ben Harris [Sun, 12 May 2024 10:57:52 +0000 (11:57 +0100)]
12: factorise contruction of can_go_x arrays somewhat

11 months ago12: Use the primitive •_while_: it's actually easier to understand
Ben Harris [Sun, 12 May 2024 10:41:46 +0000 (11:41 +0100)]
12: Use the primitive •_while_: it's actually easier to understand

11 months ago12b done
Ben Harris [Sun, 12 May 2024 10:19:46 +0000 (11:19 +0100)]
12b done

11 months ago12a done
Ben Harris [Sun, 12 May 2024 10:08:51 +0000 (11:08 +0100)]
12a done

11 months ago11a: faster Inspect copied back from 11b
Ben Harris [Sat, 11 May 2024 10:53:52 +0000 (11:53 +0100)]
11a: faster Inspect copied back from 11b

11 months ago11a and 11b done
Ben Harris [Sat, 11 May 2024 09:58:31 +0000 (10:58 +0100)]
11a and 11b done

11 months ago10b done
Ben Harris [Fri, 10 May 2024 08:41:26 +0000 (09:41 +0100)]
10b done

12 months ago10a done
Ben Harris [Fri, 10 May 2024 08:10:18 +0000 (09:10 +0100)]
10a done

12 months ago09: prep cleanup
Ben Harris [Thu, 9 May 2024 13:00:31 +0000 (14:00 +0100)]
09: prep cleanup

12 months ago09b done
Ben Harris [Thu, 9 May 2024 12:49:19 +0000 (13:49 +0100)]
09b done

12 months ago09a: restructure to calculate head and tail paths separately
Ben Harris [Thu, 9 May 2024 12:43:49 +0000 (13:43 +0100)]
09a: restructure to calculate head and tail paths separately

12 months ago09a: split head and tail steps
Ben Harris [Thu, 9 May 2024 12:34:55 +0000 (13:34 +0100)]
09a: split head and tail steps

12 months ago09a done
Ben Harris [Thu, 9 May 2024 08:40:52 +0000 (09:40 +0100)]
09a done

12 months ago09a working on example
Ben Harris [Thu, 9 May 2024 08:35:56 +0000 (09:35 +0100)]
09a working on example

12 months ago09a: successfully tracing path using fold
Ben Harris [Thu, 9 May 2024 08:25:58 +0000 (09:25 +0100)]
09a: successfully tracing path using fold

12 months ago08: explicitly construct rotations as powers of ⌽∘⍉
Ben Harris [Wed, 8 May 2024 13:37:29 +0000 (14:37 +0100)]
08: explicitly construct rotations as powers of ⌽∘⍉

12 months ago08: rotate maps rather than mirroring
Ben Harris [Wed, 8 May 2024 13:29:16 +0000 (14:29 +0100)]
08: rotate maps rather than mirroring

This is now consistent across 08a and 08b.

12 months ago08b done
Ben Harris [Wed, 8 May 2024 13:26:13 +0000 (14:26 +0100)]
08b done

12 months ago08a done
Ben Harris [Wed, 8 May 2024 08:29:13 +0000 (09:29 +0100)]
08a done

12 months ago07: slight cleanups though I'm still not happy
Ben Harris [Tue, 7 May 2024 21:26:37 +0000 (22:26 +0100)]
07: slight cleanups though I'm still not happy

12 months ago07b done (also slight readability improvement in 07a
Ben Harris [Tue, 7 May 2024 20:27:47 +0000 (21:27 +0100)]
07b done (also slight readability improvement in 07a

12 months ago07a done
Ben Harris [Tue, 7 May 2024 20:17:59 +0000 (21:17 +0100)]
07a done

12 months ago07a: store paths in the normal order (root to leaf)
Ben Harris [Tue, 7 May 2024 18:24:54 +0000 (19:24 +0100)]
07a: store paths in the normal order (root to leaf)

12 months ago07a: extract only regular files
Ben Harris [Tue, 7 May 2024 12:41:01 +0000 (13:41 +0100)]
07a: extract only regular files

12 months ago07a: got a list of files with full paths
Ben Harris [Tue, 7 May 2024 12:36:44 +0000 (13:36 +0100)]
07a: got a list of files with full paths

12 months ago07a trivial CLI that can cd
Ben Harris [Tue, 7 May 2024 08:14:37 +0000 (09:14 +0100)]
07a trivial CLI that can cd

12 months ago06: simplify code to use monadic / (Indexes)
Ben Harris [Mon, 6 May 2024 19:46:50 +0000 (20:46 +0100)]
06: simplify code to use monadic / (Indexes)

12 months ago06b done
Ben Harris [Mon, 6 May 2024 05:43:02 +0000 (06:43 +0100)]
06b done

12 months ago06a: parameterise main block by length of marker
Ben Harris [Mon, 6 May 2024 05:42:18 +0000 (06:42 +0100)]
06a: parameterise main block by length of marker

12 months ago06a gratuitously more tacit version
Ben Harris [Mon, 6 May 2024 05:37:18 +0000 (06:37 +0100)]
06a gratuitously more tacit version

12 months ago06a done
Ben Harris [Mon, 6 May 2024 05:36:27 +0000 (06:36 +0100)]
06a done

12 months ago05: simpler Prep
Ben Harris [Sun, 5 May 2024 15:26:05 +0000 (16:26 +0100)]
05: simpler Prep

12 months ago05b: remove a comment that only applied to 05a
Ben Harris [Sun, 5 May 2024 12:13:43 +0000 (13:13 +0100)]
05b: remove a comment that only applied to 05a

12 months ago05a: another place where a scalar can be automatically promoted
Ben Harris [Sun, 5 May 2024 12:12:27 +0000 (13:12 +0100)]
05a: another place where a scalar can be automatically promoted

12 months ago05a: slightly simpler Prep1Proc
Ben Harris [Sun, 5 May 2024 12:09:48 +0000 (13:09 +0100)]
05a: slightly simpler Prep1Proc

12 months ago05b done
Ben Harris [Sun, 5 May 2024 12:07:17 +0000 (13:07 +0100)]
05b done

12 months ago05a: slightly prettier ExecuteMove
Ben Harris [Sun, 5 May 2024 11:58:41 +0000 (12:58 +0100)]
05a: slightly prettier ExecuteMove

12 months ago05a done
Ben Harris [Sun, 5 May 2024 11:55:56 +0000 (12:55 +0100)]
05a done

12 months agoTidy up and comment map prep in 05a
Ben Harris [Sun, 5 May 2024 11:32:25 +0000 (12:32 +0100)]
Tidy up and comment map prep in 05a

12 months agoPrep for 05a
Ben Harris [Sun, 5 May 2024 10:28:33 +0000 (11:28 +0100)]
Prep for 05a

12 months agoA bit more Split fettling in 04
Ben Harris [Sat, 4 May 2024 12:02:59 +0000 (13:02 +0100)]
A bit more Split fettling in 04

It was silly to have an operator that immediately called its operand on
its argument and did nothing else with the operand.  Better to have a
function that takes the output of the operand as its left argument.
That avoids the confusion I had over whether the operator should take a
function that acts on a single element or on the whole list: it now
takes neither.

This doesn't even make calling the function any harder. It just changes
F _split x into F⊸Split x.

12 months agogit ignore *.eg and *.in
Ben Harris [Sat, 4 May 2024 08:50:08 +0000 (09:50 +0100)]
git ignore *.eg and *.in

Those are the names I use for my input files

12 months agoGenericise Split to modifier _split in 04
Ben Harris [Sat, 4 May 2024 08:49:13 +0000 (09:49 +0100)]
Genericise Split to modifier _split in 04

12 months ago04b done
Ben Harris [Sat, 4 May 2024 08:41:12 +0000 (09:41 +0100)]
04b done

12 months ago04a done
Ben Harris [Sat, 4 May 2024 08:39:02 +0000 (09:39 +0100)]
04a done

12 months agoSlight simplification of 03b
Ben Harris [Fri, 3 May 2024 13:10:41 +0000 (14:10 +0100)]
Slight simplification of 03b

I think I've understood ˘ now.  It's like ¨ but for rows rather than
elements.

12 months ago03b done
Ben Harris [Fri, 3 May 2024 09:26:10 +0000 (10:26 +0100)]
03b done

Still don't really understand the interaction of ˝ and ˘ though.

12 months ago03a done
Ben Harris [Fri, 3 May 2024 09:00:37 +0000 (10:00 +0100)]
03a done

12 months ago03a just needs priority
Ben Harris [Fri, 3 May 2024 08:22:56 +0000 (09:22 +0100)]
03a just needs priority

12 months ago02a and 02b done
Ben Harris [Thu, 2 May 2024 13:30:43 +0000 (14:30 +0100)]
02a and 02b done

12 months ago01b done
Ben Harris [Thu, 2 May 2024 09:59:51 +0000 (10:59 +0100)]
01b done

12 months ago01a done
Ben Harris [Thu, 2 May 2024 09:43:07 +0000 (10:43 +0100)]
01a done