adventofcode

wevrem 2023-12-10T06:37:47.771669Z

Day 10 - Solutions

Aleks 2023-12-10T09:31:07.027759Z

@michaeljweaver thanks a lot for pointing to https://en.wikipedia.org/wiki/Point_in_polygon and the trick, it helped me solve the part 2 ๐Ÿ™Œ๐Ÿป. Iโ€™m not good at geometry โ˜บ๏ธ

Aleks 2023-12-10T15:07:28.754749Z

cleaned the code up, wrote a fn to determine start shape https://github.com/zelark/AoC/blob/master/src/zelark/aoc_2023/day_10.clj

rjray 2023-12-10T18:14:43.659579Z

Also used the even-odd rule for part 2. Part 1 was fun, if kind of long to code. I'll be revising this code later; I have some hard-coded values I don't like to see. https://github.com/rjray/advent-2023-clojure/blob/master/src/advent_of_code/day10.clj

๐Ÿ‘ 1
Ivana 2023-12-10T18:48:22.945989Z

Nice task! For part 2 after unsuccessful tries with ray-crossing etc finally I just zoomed input field in 2 times, fill the area and check allinitial tiles in filled set. A bit surprized that we have to calculate all internal tiles (not only ground), so I had to make my zoom pipes different than initial ones.

Arnaud Geiser 2023-12-10T19:39:07.753419Z

All credits go to @michaeljweaver, but here I am : https://github.com/arnaudgeiser/advent-of-code/blob/master/2023/clojure/src/advent_of_code/day10.clj

genmeblog 2023-12-10T19:51:27.949939Z

Here is how the pipe looks like.

๐Ÿ”ฅ 4
โ˜๏ธ 1
Aleks 2023-12-10T19:55:48.518569Z

genmeblog 2023-12-10T20:08:53.763359Z

And my verbose solution... https://github.com/genmeblog/advent-of-code/blob/master/src/advent_of_code_2023/day10.clj

Felipe 2023-12-10T20:39:48.295239Z

I'm so close, but my flood fill is filling everything ๐Ÿ˜•

Ivana 2023-12-10T20:58:34.583309Z

And mine zoomed x2

Felipe 2023-12-11T00:16:44.678959Z

I got it! spent more than one hour looking for a hole in my flood fill. off by one error; turns out I was skipping the position adjacent to the starting one. for part 2 I decided to zoom in like @andrey.yallowsack.com

(def expand
  {\| [".X."
       ".X."
       ".X."]
   \- ["..."
       "XXX"
       "..."]
   \L [".X."
       ".XX"
       "..."]
   \7 ["..."
       "XX."
       ".X."]
   \J [".X."
       "XX."
       "..."]
   \F ["..."
       ".XX"
       ".X."]
   \. ["..."
       "..."
       "..."]})
debugging this one was a chore, but very satisfying to get it right at the end https://github.com/FelipeCortez/advent-of-code/blob/master/2023/10.clj

wevrem 2023-12-10T06:38:30.255009Z

I have my stars for Day 10, but boy it was a slog. Iโ€™ve got to clean up my code a bit before I post. Probably in the morning (my morning).

๐Ÿคช 1
2023-12-10T07:22:19.807429Z

https://gitlab.com/maximoburrito/advent2023/-/blob/main/src/day10/main.clj I couldn't figure out how to make what I thought was the obvious solution work, so instead I literally converted the pipe map to 3x size so I could do a trivial bfs to find what is inside and outside. Looking at @michaeljweaver's solution, I'm still not entirely sure why it works and why you don't have to also check vertically, but I'm sure it'll make more sense in the morning ๐Ÿ™‚

erdos 2023-12-10T07:33:49.681169Z

https://github.com/erdos/advent-of-code/blob/master/2023/day10.clj For the second part, I went through the path again and cleared all other cells. Then I went thought the path the third time and kept track of the cells to my left hand side and used these as an input to a flood fill.

wevrem 2023-12-10T07:34:17.401139Z

I did an https://en.wikipedia.org/wiki/Point_in_polygon algorithm for determining whether a point is inside a polygon. I tried to be fancy and check along rows or columns depending on which edge was closer, but I gave that up and just checked โ€˜aboveโ€™.

๐Ÿ‘ 1
erdos 2023-12-10T07:34:44.038259Z

looks like we have 3 merely different approaches so far.

wevrem 2023-12-10T07:36:06.791939Z

The trick was that if these types of patterns are above a point:

7   F
|   |
J   L
they donโ€™t count as crossing, but these do count:
7   F
|   |
L   J
and obviously
-
counts as a crossing.

๐Ÿ‘ 1
๐Ÿ˜ 3
danielneal 2023-12-12T15:36:23.067629Z

Omg day 10 took far too long, I think itโ€™s time for me to bow out of advent of code so I have some headspace for my real job https://github.com/danielneal/advent-of-code-2023/blob/main/src/day10.clj

alpox 2023-12-12T20:20:10.600559Z

This one took me much too long and the code didnโ€™t end up nice either ๐Ÿ˜• at least its solvedโ€ฆ Also went with the even-odd rule

2023-12-11T17:03:45.547409Z

Hi folks! My Day 10 https://github.com/mtravers/aoc2023/blob/main/src/aoc2023/day10.clj