adventofcode

borkdude 2021-12-11T10:33:24.045100Z

I'm skipping today's one, I think. Another grid puzzle ;)

👍 1
😲 1
Sidestep 2021-12-11T12:11:26.046900Z

Some devs suggested Fennel, which is Lua based, for some AOC challenges

Sidestep 2021-12-11T12:11:43.047300Z

how come? how does Fennel help?

Cora (she/her) 2021-12-11T12:48:39.049600Z

I was just trying it out, it doesn't really help

genmeblog 2021-12-11T17:02:51.053500Z

Day 11 animation, it's flashing (epilepsy warning) so I hid it in a thread. Cubic interpolation is used to generate bigger image.

✨ 3
🤩 1
winsome 2021-12-13T17:01:07.098800Z

I feel like I would be able to navigate even when the octopi aren't all synced up :p

genmeblog 2021-12-11T17:04:13.053600Z

tschady 2021-12-11T17:33:58.054900Z

advent-of-animations, I’m inspired.

2021-12-11T17:48:58.055600Z

thanks for the threaded animation! looks very cool but nice to not have flashing by default

genmeblog 2021-12-11T19:34:43.057700Z

Yeah, I know it may be problematic for some people.

Antonio Bibiano 2021-12-11T19:54:08.059300Z

what's the plural of octopus? octopi?

Cora (she/her) 2021-12-11T20:50:31.060100Z

it's complicated

2021-12-11T20:48:00.059600Z

Can someone confirm something about Day 11 for me. Question in thread

2021-12-11T20:48:26.059700Z

For the small example input

1	1	1	1	1
1	9	9	9	1
1	9	1	9	1
1	9	9	9	1
1	1	1	1	1
Does this eventually end up as
1	1	1	1	1
1	1	1	1	1
1	1	1	1	1
1	1	1	1	1
1	1	1	1	1
?

nbardiuk 2021-12-11T20:51:23.060600Z

yes, octopuses eventually syncronize, all the values in the grid became the same

👍 1
R.A. Porter 2021-12-11T04:22:39.041Z

I needed Day 10. I still haven't been able to solve part 2 of Day 9 (I'm going to punt for now) even though I know how to solve it. I just can't seem to write an implementation that doesn't either short-cut in a way that breaks or blows out my stack in skipping shortcuts. But Day 10? That was built for Lispers.

2021-12-11T18:34:29.056300Z

agreed. day 10 was a joy

Aleks 2021-12-11T04:58:44.041300Z

🧵Day 11 answers thread: post your answers here

euccastro 2021-12-12T17:13:40.073500Z

I couldn't get to this yesterday. I expected second half to be harder; I was glad I had built step 1 on top of iterate so I could just reuse it for step 2. I guess I could clean it up but I have to do day 12 first: https://github.com/euccastro/advent-of-code-2021/blob/main/day11.clj

tschady 2021-12-11T12:00:18.045500Z

https://github.com/tschady/advent-of-code/blob/main/src/aoc/2021/d11.clj 17ms / 28ms

👏 1
Callum Oakley 2021-12-11T12:34:52.047700Z

not my most concise solution… avoids scanning the whole map any more than once per step by checking if an octopus is ready to flash at increment time and pushing it on a stack. lots of passing state around to make that work though. I was expecting part 2 to be “simulate for a really long time” 🤷 (I also didn’t look at the input and see that it was tiny facepalm) 13ms/42ms https://github.com/callum-oakley/advent-of-code/blob/main/src/aoc/2021/11.clj

Joe 2021-12-11T12:47:46.048300Z

Day 11 https://github.com/RedPenguin101/aoc2021/blob/main/day11.md and https://github.com/RedPenguin101/aoc2021/blob/main/clojure/src/aoc2021/day11.clj One of those things where the code started out pretty messy, but I got into a 'virtuous spiral' of refactoring, ending up with a quite readable (I think) solution. Definitely not fast! But sub-second, which is good enough I think.

2021-12-11T14:34:41.050200Z

https://github.com/kfirmanty/advent-of-code-2021/blob/main/src/day11.clj - my first pass at solution - nothing fancy on my side, just plain loop through the board but seems to do the trick and executes part-2 in 163ms on my machine

Andrew Byala 2021-12-11T19:21:43.057100Z

Wrote mine last night, and then rewrote it this morning. I used a recursive cascade-flashes function instead of keeping track of which points I had already flashed; it was a little less efficient than my original loop-recur, but I think it looks cleaner. • https://github.com/abyala/advent-2021-clojure/blob/main/docs/day11.mdhttps://github.com/abyala/advent-2021-clojure/blob/main/src/advent_2021_clojure/day11.clj

Antonio Bibiano 2021-12-11T19:41:05.057900Z

My solution for today

Antonio Bibiano 2021-12-11T19:42:45.058300Z

I was really bummed that update-in throws when given an invalid array position like [-1 0]

Antonio Bibiano 2021-12-11T19:43:16.058500Z

and at some point i learned that get-in returns the whole coll if the key is nil

💡 1
Sam Adams 2021-12-11T21:42:32.061300Z

my basic solution: https://samadams.dev/2021/12/11/advent-of-code-day-11.html

2021-12-12T01:42:47.061800Z

Horrible solution by me today. For whatever reason I couldn't get my head around grids, so I represented it as a flat vector. I also think I compensated for my brain not working by building it into a way too complicated data structure. Each cell looked like this

{:n 0 :flashed false :flashes 0 :xy [0 0] :i 0}
I know, dumb. BUt at least it's done, and it runs instantly. https://gist.github.com/stuartstein777/65179a928273e201af0b256a7b024487#file-2021-day-11-clj-L7 Definitely one I need to rethink when my brain is working better and re-work

2021-12-11T06:04:16.042800Z

fastest time from part 1 to part 2 yet - it's always nice when that happens

👏 3
Aleks 2021-12-11T07:01:28.043400Z

Need to think if I can apply frequencies here 😆

😂 4
Aleks 2021-12-11T07:16:50.043800Z

https://twitter.com/algrison/status/1469555494461313026

🐙 7
Andrew Byala 2021-12-11T19:23:14.057500Z

Very cool, @zelark! What did you use for visualization?

Aleks 2021-12-12T04:56:01.062100Z

@abyala I didn’t do it. It is made by @a.grison https://github.com/agrison/advent-of-code

👍 1