<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Advent of Code on Hieu Phay</title><link>https://hieuphay.com/series/advent-of-code/</link><description>Recent content in Advent of Code on Hieu Phay</description><generator>Hugo</generator><language>en</language><managingEditor>Nguyen Duc Hieu</managingEditor><webMaster>Nguyen Duc Hieu</webMaster><atom:link href="https://hieuphay.com/series/advent-of-code/index.xml" rel="self" type="application/rss+xml"/><item><title>Advent of Code 2021 in Julia – Day 18: Snailfish</title><link>https://hieuphay.com/AoC2021-day18/</link><pubDate>Sun, 19 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day18/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day18/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day18/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This one was quite difficult.&#10;It took me 2 days to solve this one.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;Show challenge - day 18, part 1&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You descend into the ocean trench and encounter some &lt;a href="https://en.wikipedia.org/wiki/Snailfish"&gt;snailfish&lt;/a&gt;.&#10;They say they saw the sleigh keys!&#10;They&amp;rsquo;ll even tell you which direction the keys went if you help one of the smaller snailfish with his &lt;strong&gt;math homework&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 17: Trick Shot</title><link>https://hieuphay.com/AoC2021-day17/</link><pubDate>Fri, 17 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day17/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day17/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day17/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;An easy puzzle for today&amp;rsquo;s.&#10;I wonder if there is a more clever solution&amp;hellip;&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 17, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You finally decode the Elves&amp;rsquo; message.&#10;&lt;code&gt;HI&lt;/code&gt;, the message says.&#10;You continue searching for the sleigh keys.&lt;/p&gt;&#10;&lt;p&gt;Ahead of you is what appears to be a large &lt;a href="https://en.wikipedia.org/wiki/Oceanic%5Ftrench"&gt;ocean trench&lt;/a&gt;.&#10;Could the keys have fallen into it? You&amp;rsquo;d better send a probe to investigate.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 16: Packet Decoder</title><link>https://hieuphay.com/AoC2021-day16/</link><pubDate>Thu, 16 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day16/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day16/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day16/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;I can feel the difficulty ramping up in the last few days.&#10;For the second part of the puzzle, I had to utilized Julia&amp;rsquo;s meta-programming capacity.&#10;It&amp;rsquo;s the first time I touched the meta-programming section in the Julia documentation.&#10;Fortunately my code worked fine this time, and I can still keep up with solving the puzzles during the same day they&amp;rsquo;re released.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 15: Chiton</title><link>https://hieuphay.com/AoC2021-day15/</link><pubDate>Wed, 15 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day15/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day15/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day15/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The one today is difficult but fun!&#10;It provided a very nice example for dynamic programming.&#10;I would probably revisit this puzzle again if I have the time.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 15, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You&amp;rsquo;ve almost reached the exit of the cave, but the walls are getting closer together.&#10;Your submarine can barely still fit, though; the main problem is that the walls of the cave are covered in &lt;a href="https://en.wikipedia.org/wiki/Chiton"&gt;chitons&lt;/a&gt;, and it would be best not to bump any of them.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 14: Extended Polymerization</title><link>https://hieuphay.com/AoC2021-day14/</link><pubDate>Tue, 14 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day14/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day14/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day14/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The puzzle today is akin to that in &lt;a href="https://hieuphay.com/AoC2021-day6/"&gt;day 6&lt;/a&gt;: A naive, recursive implementation works for part 1, but is too intensive for part 2, and requires a different approach.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 14, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;The incredible pressures at this depth are starting to put a strain on your submarine.&#10;The submarine has &lt;a href="https://en.wikipedia.org/wiki/Polymerization"&gt;polymerization&lt;/a&gt; equipment that would produce suitable materials to reinforce the submarine, and the nearby volcanically-active caves should even have the necessary input elements in sufficient quantities.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 13: Transparent Origami</title><link>https://hieuphay.com/AoC2021-day13/</link><pubDate>Mon, 13 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day13/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day13/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day13/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Alright! We&amp;rsquo;re halfway through!&#10;The puzzle today is easier than the last, as a &amp;ldquo;monday&amp;rdquo; puzzle would, but it is fun nontheless.&#10;The puzzle format break out from the tradition of &amp;ldquo;compute in this method and return this number.&amp;rdquo;&#10;To solve for the puzzle today, you actually have to visualize to see the output.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 13, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You reach another volcanically active part of the cave.&#10;It would be nice if you could do some kind of thermal imaging so you could tell ahead of time which caves are too hot to safely enter.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 12: Passage Pathing</title><link>https://hieuphay.com/AoC2021-day12/</link><pubDate>Sun, 12 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day12/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day12/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day12/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The puzzle today competely wrecked me!&#10;I spent like three hours on this one.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 12, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;With your submarine&amp;rsquo;s subterranean subsystems subsisting suboptimally, the only way you&amp;rsquo;re getting out of this cave anytime soon is by finding a path yourself.&#10;Not just &lt;strong&gt;a&lt;/strong&gt; path - the only way to know if you&amp;rsquo;ve found the &lt;strong&gt;best&lt;/strong&gt; path is to find &lt;strong&gt;all&lt;/strong&gt; of them.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 11: Dumbo Octopus</title><link>https://hieuphay.com/AoC2021-day11/</link><pubDate>Sat, 11 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day11/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day11/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day11/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;I like the concept behind the puzzle today.&#10;It&amp;rsquo;s about autonomous synchronization.&#10;It happens in the nature all the time, see &lt;a href="https://ncase.me/fireflies/"&gt;this simulation&lt;/a&gt;.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 11, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You enter a large cavern full of rare bioluminescent &lt;a href="https://www.youtube.com/watch?v=eih-VSaS2g0"&gt;dumbo octopuses&lt;/a&gt;!&#10;They seem to not like the Christmas lights on your submarine, so you turn them off for now.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 10: Syntax Scoring</title><link>https://hieuphay.com/AoC2021-day10/</link><pubDate>Fri, 10 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day10/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day10/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day10/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The puzzle today was sort of interesting, because my solution is quite unique.&#10;Because this puzzle is inspired by real-life &lt;a href="https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization"&gt;bracket pairing problems&lt;/a&gt;, people typically implement an algorithm along that line.&#10;But I was completely oblivious of those algorithm, so I had another approach!&#10;My attempt works fine for this puzzle, but i&amp;rsquo;s probably useless if I want to expand my solution to a full-fledge parser.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 9: Smoke Basin</title><link>https://hieuphay.com/AoC2021-day9/</link><pubDate>Thu, 09 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day9/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day9/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day9/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;I feel like it&amp;rsquo;s almost everyday that I can say something like:&#10;&amp;ldquo;Oooh, I thought it was going to be easy, but then it&amp;rsquo;s &lt;span class='smallcap'&gt;not&lt;/span&gt;!&amp;rdquo;&#10;Well&amp;hellip; That&amp;rsquo;s certainly the case for today.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 9, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;These caves seem to be &lt;a href="https://en.wikipedia.org/wiki/Lava%5Ftube"&gt;lava tubes&lt;/a&gt;.&#10;Parts are even still volcanically active; small hydrothermal vents release smoke into the caves that slowly settles like rain.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 8: Seven Segment Search</title><link>https://hieuphay.com/AoC2021-day8/</link><pubDate>Wed, 08 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day8/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day8/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day8/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day8/#benchmark"&gt;Benchmark&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This one is not too hard, but a brain teaser nonetheless.&#10;The key thing I learnt today is that strings in Julia are arrays of characters, so you can use set operators to check for things like &lt;code&gt;&amp;quot;ab&amp;quot; ⊆ &amp;quot;cab&amp;quot;&lt;/code&gt;, which should return &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 8, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You barely reach the safety of the cave when the whale smashes into the cave mouth, collapsing it.&#10;Sensors indicate another exit to this cave at a much greater depth, so you have no choice but to press on.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 7: The Treachery of Whales</title><link>https://hieuphay.com/AoC2021-day7/</link><pubDate>Tue, 07 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day7/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day7/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day7/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;Today&amp;rsquo;s challenge is quite simple.&#10;Blame Julia for having a good set of defaults.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 7, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;A giant &lt;a href="https://en.wikipedia.org/wiki/Sperm%5Fwhale"&gt;whale&lt;/a&gt; has decided your submarine is its next meal, and it&amp;rsquo;s much faster than you are.&#10;There&amp;rsquo;s nowhere to run!&lt;/p&gt;&#10;&lt;p&gt;Suddenly, a swarm of crabs (each in its own tiny submarine - it&amp;rsquo;s too deep for them otherwise) zooms in to rescue you!&#10;They seem to be preparing to blast a hole in the ocean floor; sensors indicate a &lt;strong&gt;massive underground cave system&lt;/strong&gt; just beyond where they&amp;rsquo;re aiming!&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 6: Lanternfish</title><link>https://hieuphay.com/AoC2021-day6/</link><pubDate>Mon, 06 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day6/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day6/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day6/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day6/#bonus-boids-simulation"&gt;Bonus: Boids simulation&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The problem today is a bit of a breather. (Puzzles are easier on weekdays.)&#10;Still, I fell right into their trap!&#10;But it&amp;rsquo;s alright.&#10;In fact, I really like this puzzle, because I had tons of fun toying with its visualization!&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;Show challenge - day 6, part 1&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;The sea floor is getting steeper.&#10;Maybe the sleigh keys got carried this way?&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 5: Hydrothermal Venture</title><link>https://hieuphay.com/AoC2021-day5/</link><pubDate>Sun, 05 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day5/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day5/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day5/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day5/#bonus-animations"&gt;Bonus: Animations!&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;I thought the challenge today would be easy, but in the end I spent too much time on it.&#10;Around halfway through I realized that I forgot to offset the index, because Julia indexes begin at 1 instead of 0.&#10;On the other hand, I learnt how slurping and splatting with &lt;code&gt;...&lt;/code&gt; works, which provide shorthand for &amp;ldquo;unwrapping&amp;rdquo; arrays, to be used inside functions.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 4: Giant Squid</title><link>https://hieuphay.com/AoC2021-day4/</link><pubDate>Sat, 04 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day4/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day4/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day4/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;The challenge today is a bigger one.&#10;You basically have to write a Bingo verifier.&#10;It&amp;rsquo;s the first one that I had to resort to importing another library (&lt;code&gt;DelimitedFiles&lt;/code&gt;), but I would argue that because &lt;code&gt;DelimitedFiles&lt;/code&gt; is bundled within Julia installation, it&amp;rsquo;s not a cheat ;)&#10;The library did not play any role in the meat of the puzzle anyway.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 4, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;You&amp;rsquo;re already almost 1.5km (almost a mile) below the surface of the ocean, already so deep that you can&amp;rsquo;t see any sunlight. What you &lt;strong&gt;can&lt;/strong&gt; see, however, is a giant squid that has attached itself to the outside of your submarine.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 3: Binary Diagnostic</title><link>https://hieuphay.com/AoC2021-day3/</link><pubDate>Fri, 03 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day3/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day3/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day3/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;It&amp;rsquo;s getting interesting!&#10;Today&amp;rsquo;s problem got me stucked for a while &amp;ndash; mainly because I didn&amp;rsquo;t read the question closely enough.&#10;For this excercise I work with matrices, which Julia handles really well.&lt;/p&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 3, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;The submarine has been making some odd creaking noises, so you ask it to produce a diagnostic report just in case.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 2: Dive!</title><link>https://hieuphay.com/AoC2021-day2/</link><pubDate>Thu, 02 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day2/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day2/#part-1"&gt;Part 1&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day2/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;h2 id="part-1"&gt;&#10; Part 1&#10; &lt;a class="heading-link" href="#part-1" aria-labelledby="part-1"&gt;&#10; &lt;i class="fa fa-link" aria-hidden="true"&gt;&lt;/i&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;details&gt;&#10;&lt;summary&gt;&#10;Show challenge - day 2, part 1&#10;&lt;/summary&gt;&#10;&lt;div class="details"&gt;&#10;&lt;p&gt;Now, you need to figure out how to pilot this thing.&lt;/p&gt;&#10;&lt;p&gt;It seems like the submarine can take a series of commands like forward 1, down 2, or up 3:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;forward X increases the horizontal position by X units.&lt;/li&gt;&#10;&lt;li&gt;down X increases the depth by X units.&lt;/li&gt;&#10;&lt;li&gt;up X decreases the depth by X units.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Note that since you&amp;rsquo;re on a submarine, down and up affect your depth, and so they have the opposite result of what you might expect.&lt;/p&gt;</description></item><item><title>Advent of Code 2021 in Julia – Day 1: Sonar Sweep</title><link>https://hieuphay.com/AoC2021-day1/</link><pubDate>Wed, 01 Dec 2021 00:00:00 +0000</pubDate><guid>https://hieuphay.com/AoC2021-day1/</guid><description>&lt;div class="ox-hugo-toc toc"&gt;&#10;&lt;div&gt;&lt;/div&gt;&#10;&lt;div class="heading"&gt;Table of Contents&lt;/div&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day1/#part-1"&gt;Part 1:&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://hieuphay.com/AoC2021-day1/#part-2"&gt;Part 2&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;/div&gt;&#10;&lt;!--endtoc--&gt;&#10;&lt;p&gt;This is my attempt to the &lt;a href="https://adventofcode.com/2021/about"&gt;Advent of Code&lt;/a&gt; challenge.&#10;It is a yearly event where you solve coding puzzles every day from December 1st until December 25th.&#10;The puzzles are not too hard or technical, and you can use any language you like to solve them &amp;ndash; a perfect opportunity for me to learn a new language.&#10;And who can turn down some fun puzzles anyway?&lt;/p&gt;</description></item></channel></rss>