Day 8: Resonant Collinearity
Megathread guidelines
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
FAQ
- What is this?: Here is a post with a large amount of details: https://programming.dev/post/6637268
- Where do I participate?: https://adventofcode.com/
- Is there a leaderboard for the community?: We have a programming.dev leaderboard with the info on how to join in this post: https://programming.dev/post/6631465
You are viewing a single thread.
View all comments 4 points
Uiua
Adapting the part one solution for part two took me longer than part one did today, but I didnât want to change much anymore.
I even got scolded by the interpreter to split the evaluating line onto multiple ones because it got too long.
Canât say itâs pretty but it does itâs job ^^â
Run with example input here
PartOne â (
&rs â &fo "input-8.txt"
â(â˝ÂŹâ".\n".â´)
âââ @\n.
:¤â(:¤-1âł)
âĄ(âĄââ)
â´/âââ(âĄ(-:â-°â)â§
â 2)
⧝â˝ÂŹ:â(/+â+)ââ><,0
)
PartTwo â (
&rs â &fo "input-8.txt"
â(â˝ÂŹâ".\n".â´â¤
â˝:ââĄ(>1⧝ââ)
)
âââ @\n.
:¤â(:¤-1âł)
âĄ(âĄââ)
â¸â(
â§
â 2â¤
âĄ(:¤â-°â
â˘(âââ-ââ¸â˘
| â
(=0/++â><,0â˘))
âĄâââ
)
)
â´/ââ/ââ
⧝â˝ÂŹ:â(/+â+)ââ><,0
)
&p "Day 8:"
&pf "Part 1: "
&p PartOne
&pf "Part 2: "
&p PartTwo