Show older

AoC 2020 Day 15 

I'm glad I'm not using Haskell lol it would be hell to try to optimize IntMaps or whatever

AoC 2020 Day 15 

I wonder why vector works faster than hashtables
I didn't think hashing smth would be 5x slower but I guess it is

AoC 2020 Day 15 

wot is fixnum
I'm guessing fixed-point numbers but I don't see why a specialized vector for it would be useful
Must have some obscure low-level applications I don't consider in my lofty tower of abstraction

AoC 2020 Day 15 

Oh because racket has arbitrary-size numbers and using fixnums would force it to use the more space-efficient number
I suppose I could try fixnum vectors

AoC 2020 Day 15 

"A fxvector is like a vector, but it holds only fixnums. The only advantage of a fxvector over a vector is that a shared version can be created with functions like shared-fxvector."

Never mind lmao

AoC 2020 Day 15 

protagonist is HACKING AIRPORT SECURITY CAMERA

AoC 2020 Day 15 

I've determined the indices of the fields that could belong to the first six ranges. They are:

'(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)

so, all of them,

AoC 2020 Day 15 

Oh I accidentally did 1-6 instead of 0-5. But here's the list:

'(1 3 4 5 6 7 8 9 10 11 12 14) :/

Here's the list of the valid indices for each field:

'((14 10 8 6) (16 14 10 8 6 4 2 17 0 15 13 9 7 5 3 1) (6) (16 14 10 8 6 4 2 17 0 15 13 11 9 7 5 3 18 1) (16 14 10 8 6 4 2 17 9 7 5 1) (16 14 10 8 6 4 2 17 0 13 9 7 5 3 1) (16 14 10 8 6 4 2 17 0 15 13 9 7 5 3 18 1) (16 14 10 8 6 17 9 7 5 1) (16 14 12 10 8 6 4 2 17 0 15 13 11 9 7 5 3 18 1) (16 14 10 8 6 4 2 17 0 9 7 5 3 1) (16 14 10 8 6 2 17 9 7 5 1) (16 14 10 8 6 4 2 17 9 7 5 3 1) (16 14 12 10 8 6 4 19 2 17 0 15 13 11 9 7 5 3 18 1) (14 10 8 6 17 7) (16 14 10 8 6 17 9 7 5) (16 14 10 8 6 17 9 7) (14 10 8 6 7) (10 6) (10 8 6) (16 14 10 8 6 17 7))

I guess I'll have to do some constraint-solving...

AoC 2020 Day 15 

I'm currently big struggle to make my solving correkt

AoC 2020 Day 16 

I'm gonna quickly refactor to not use mutable sets before I push

AoC 2020 Day 16 

wait omfg (for ([i n])) iterates through (range n)?? I didn't know this omg

AoC 2020 Day 16 

okay now that I'm done it's time to get into bed and read haskal's solution

AoC 2020 Day 16 

I swear I keep forgetting for loop keywords
I did an if-then-0 in my for/sum instead of simply using #:when, like a fool

AoC 2020 Day 16 

Great it's another graph day
I didn't see the graph this time

AoC 2020 Day 16 

I've taken the 4th-year algorithms course and yet I remember nothing

AoC 2020 Day 16 

Oh my god it's so obvious. Of course it's maximum matching, you have edges between fields and the ranges they could belong to and you need a mapping from one to one exactly

AoC 2020 Day 16 

I'm so mad
I'm resisting the temptation to immediately get up and go fix my solution to use a graph

AoC 2020 Day 16 

I've decided not to use graphing
The part of the code the max bipartite matching would replace is only seven lines anyway so I don't think the solution would be any more concise
It's already a short enough solution really and even switching from using mutable vectors and sets to lists only it still runs pretty quick
I don't think it would be worth it

AoC 2020 Day 17 

NO not ANOTHER GRID PROBLEM

AoC 2020 Day 17 

what Do you MEAN FOUR DIMENTIOSNalsj AHASPACE

AoC 2020 Day 17 

How do I generalize this lmao I've got... I've copypasted my 3D sol and added a dimension lmao

AoC 2020 Day 17 

I was thinking I could tighten up vthe range of locations I check but looking at the visualizations on Reddit it seems like it's pretty monotonic and dense so I don't think any optimizations there would help

AoC 2020 Day 18 

I wasted so much time looking up how to read a string as an s-expression LMAO
It's (read (open-input-string str))... jsyk...

AoC 2020 Day 18 

I think this one would be pretty easy in Haskell bc you could probably redefine - and + with different infixities
or even define new infix operators and string-replace all of your - and +

AoC 2020 Day 18 

I am so pleased with this one lol

AoC 2020 Day 18 

oh man compared to yesterday this was a heckin' stroll in teh park

AoC 2020 Day 19 

I'm pleased with my solution... now that I've found it lmao
I was so sure in the beginning that I was doing it the very bad no good way and should've used a graph or smth but as it turns out I can indeed just generate all of the strings that the rules produce (at least, for rules 42 and 31, which were the only ones I needed)

AoC 2020 Day 19 

I enjoy that all of my solutions so far are fewer than 100 lines of code (with reasonable column widths ofc), but I do also have a 300-line custom library lol

AoC 2020 Day 19 

spread out those 300 lines over 15 days, that's 20 extra lines per day, and my days are at most 70 lines, so it's still under 100 "amortized"

AoC 2020 Day 19 

Sometimes I feel like I need to add like 50 lines of comments to explain what I'm doing
`ruleset` in my solution for today is particularly unfathomable

AoC 2020 Day 19 

it contains an apply append of a map of a map of an apply string-append of an apply cartesian-product of a map
very cursed

AoC 2020 Day 19 

I think the only days that felt like cheating were when I used `solve-chinese` and the one with the bags because I just used a graph lib

AoC 2020 Day 19 

I think I could do it without the graph lib, I just need to implement bfs
...hmmm...

Follow

re: AoC 2020 Day 20 

@nonphatic oh god

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Awoo Space

Awoo.space is a Mastodon instance where members can rely on a team of moderators to help resolve conflict, and limits federation with other instances using a specific access list to minimize abuse.

While mature content is allowed here, we strongly believe in being able to choose to engage with content on your own terms, so please make sure to put mature and potentially sensitive content behind the CW feature with enough description that people know what it's about.

Before signing up, please read our community guidelines. While it's a very broad swath of topics it covers, please do your best! We believe that as long as you're putting forth genuine effort to limit harm you might cause – even if you haven't read the document – you'll be okay!