From b316bdc6ca2856fa0d3d777ce757ac8ae995ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Da=CC=81vid=20Ne=CC=81meth=20Cs?= Date: Wed, 4 Dec 2024 08:39:19 +0100 Subject: [PATCH] 2024/04 --- 2024/Day04/README.md | 8 ++++++ 2024/Day04/Solution.cs | 61 ++++++++++++++++++++++++++++++++++++++++ 2024/Day04/input.in | Bin 0 -> 19762 bytes 2024/Day04/input.refout | 2 ++ 2024/SplashScreen.cs | 53 +++++++++++++++++++++++----------- 2024/calendar.svg | 8 +++--- 6 files changed, 111 insertions(+), 21 deletions(-) create mode 100644 2024/Day04/README.md create mode 100644 2024/Day04/Solution.cs create mode 100644 2024/Day04/input.in create mode 100644 2024/Day04/input.refout diff --git a/2024/Day04/README.md b/2024/Day04/README.md new file mode 100644 index 00000000..b7d51154 --- /dev/null +++ b/2024/Day04/README.md @@ -0,0 +1,8 @@ +## --- Day 4: Ceres Search --- +"Looks like the Chief's not here. Next!" One of The Historians pulls out a device and pushes the only button on it. After a brief flash, you recognize the interior of the [Ceres monitoring station](/2019/day/10)! + +As the search for the Chief continues, a small Elf who lives on the station tugs on your shirt; she'd like to know if you could help her with her word search (your puzzle input). She only has to find one word: XMAS. + +This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping other words. It's a little unusual, though, as you don't merely need to find one instance of XMAS - you need to find all of them. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .: + +Read the [full puzzle](https://adventofcode.com/2024/day/4). diff --git a/2024/Day04/Solution.cs b/2024/Day04/Solution.cs new file mode 100644 index 00000000..b5cfcc9f --- /dev/null +++ b/2024/Day04/Solution.cs @@ -0,0 +1,61 @@ +namespace AdventOfCode.Y2024.Day04; + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Numerics; +using System.Linq; + +using Map = System.Collections.Immutable.ImmutableDictionary; + +[ProblemName("Ceres Search")] +class Solution : Solver { + + Complex Up = -Complex.ImaginaryOne; + Complex Down = Complex.ImaginaryOne; + Complex Left = -1; + Complex Right = 1; + + public object PartOne(string input) { + var mat = GetMap(input); + return ( + from pt in mat.Keys + from dir in new[] { Right, Right + Down, Down + Left, Down} + where Matches(mat, pt, dir, "XMAS") + select 1 + ).Count(); + } + + public object PartTwo(string input) { + var mat = GetMap(input); + return ( + from pt in mat.Keys + where + Matches(mat, pt + Up + Left, Down + Right, "MAS") && + Matches(mat, pt + Down + Left, Up + Right, "MAS") + select 1 + ).Count(); + } + + // check if the pattern (or its reverse) can be read in the given direction + // starting from pt + bool Matches(Map map, Complex pt, Complex dir, string pattern) { + var chars = Enumerable.Range(0, pattern.Length) + .Select(i => map.GetValueOrDefault(pt + i * dir)) + .ToArray(); + return + Enumerable.SequenceEqual(chars, pattern) || + Enumerable.SequenceEqual(chars, pattern.Reverse()); + } + + // store the points in a dictionary so that we can iterate over them and + // to easily deal with points outside the area using GetValueOrDefault + Map GetMap(string input) { + var map = input.Split("\n"); + return ( + from y in Enumerable.Range(0, map.Length) + from x in Enumerable.Range(0, map[0].Length) + select new KeyValuePair(Complex.ImaginaryOne * y + x, map[y][x]) + ).ToImmutableDictionary(); + } +} \ No newline at end of file diff --git a/2024/Day04/input.in b/2024/Day04/input.in new file mode 100644 index 0000000000000000000000000000000000000000..9f76d332e08cdfe6faa76ceecd9e3e1dc437bbf2 GIT binary patch literal 19762 zcmV(pK=8i+M@dveQdv+`03KSDBnYVk@1A1cvq~l`h#f_HFDK53d5Rfa=-PYH(EY(Z zAsU7KbtQ-6Al|AgV`soh-F@;v`}E2EB+s5qPLz!pL!>H=QiNT%dfEsjRu$P7#wDXn zhB(wJ1U#gTmcViG+ZQ}Xf#d5$eX5t25cBi`;iXf=~;)Cx`F-V zK0q`S1w2)@$KV%u3X$_Gs_`Ms72+}J+kzH*uX0z}E9C?h$x*%#BQ`t0^fvQ9`1 zm?+mGXKDvOZWD#JZmlxy`9VA15V{DoCJ(WqIJ82!-^R@OPF0qiN-D3v*OlWY#z^a9 z2896n8E~EDeL_=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wze}b!UDUThxzio zxd<8JhFd3xrtA>+<*jm7vK@l7E7!K)>k?J9*AMUd1MB#BcyCSX0n1PlhZ>{b4vU0= zAMh!WZ@joxlLbNB$oVh@N%RL_S4|g7R2-;{a6J4djf0!TIH%~lf~?QCg|I*M94gZD z^%tN%&`~6m=>D2co8r#>GH^T63hVz3DGUu!zN#q3C6H5IgYX3Tu{3#=`hG#Ea+LCc z=32@B_x_w>s+joBCPT9}|GCAMjC~?Y`cIxd?{FG{@;P?H`Nl8-GFI;zmN0BD7s2oDUZgvRsh{zCQl`%+VB?mk4r@j`WBvMgs;K0- zAUxWCfOM{F7OI1g<0@=YScP#VjX&TzwllB>N!BC%F+P#!L83mrN{9A6^=edt{0+Nd zR&VipJQAa;_L>F01psh*aZb#LUko(xmJ6{wF&2vntu52woQWURWKTfQ+ioxC^UC3z z0XKi!n7+F;8am3&L#I8ba9Kl%Hp_f8#iaW24cy;G1|UdcRkb#_*QY$8zEWnhpd9A^ z!k}1keu5A4#b`FA^qt+Ep*Hj#);qtz+ihjB^`DQziK(XoK z#BXg?a;1tFj;&$d>Zq{L51CH|2{-AxA2(?dV7gXiJNa%I9}_}W!yb%UZ;oV%^T zLb+J_dej}#KQ2K)H!-4<=zF|_DTfgyJ0e26;)}Z4V0%V{G<62Ze76r2tIzZRNC^MS RXZXE&{>e~$&%a(!E}3fTe6Iii literal 0 HcmV?d00001 diff --git a/2024/Day04/input.refout b/2024/Day04/input.refout new file mode 100644 index 00000000..947b78a7 --- /dev/null +++ b/2024/Day04/input.refout @@ -0,0 +1,2 @@ +2414 +1871 \ No newline at end of file diff --git a/2024/SplashScreen.cs b/2024/SplashScreen.cs index 5956e6cc..3138a852 100644 --- a/2024/SplashScreen.cs +++ b/2024/SplashScreen.cs @@ -8,8 +8,8 @@ public void Show() { var color = Console.ForegroundColor; Write(0xcc00, false, " ▄█▄ ▄▄█ ▄ ▄ ▄▄▄ ▄▄ ▄█▄ ▄▄▄ ▄█ ▄▄ ▄▄▄ ▄▄█ ▄▄▄\n █▄█ █ █ █ █ █▄█ █ █ █ █ █ █▄ "); - Write(0xcc00, false, " █ █ █ █ █ █▄█\n █ █ █▄█ ▀▄▀ █▄▄ █ █ █▄ █▄█ █ █▄ █▄█ █▄█ █▄▄ {'year': 2024}\n "); - Write(0xcc00, false, " \n "); + Write(0xcc00, false, " █ █ █ █ █ █▄█\n █ █ █▄█ ▀▄▀ █▄▄ █ █ █▄ █▄█ █ █▄ █▄█ █▄█ █▄▄ $year = 2024\n "); + Write(0xcc00, false, "\n "); Write(0xcccccc, false, ".--'"); Write(0xe3b585, false, "~ ~ ~"); Write(0xcccccc, false, "| .-' "); @@ -47,21 +47,40 @@ public void Show() { Write(0x886655, false, "__------"); Write(0xcccccc, false, "| 3 "); Write(0xffff66, false, "**\n "); - Write(0x333333, false, "| | | | "); - Write(0x666666, false, " 4\n 5\n "); - Write(0x666666, false, " 6\n 7\n "); - Write(0x666666, false, " 8\n "); - Write(0x666666, false, " 9\n 10\n "); - Write(0x666666, false, " 11\n "); - Write(0x666666, false, " 12\n 13\n "); - Write(0x666666, false, " 14\n "); - Write(0x666666, false, " 15\n 16\n "); - Write(0x666666, false, " 17\n "); - Write(0x666666, false, " 18\n 19\n "); - Write(0x666666, false, " 20\n "); - Write(0x666666, false, " 21\n 22\n "); - Write(0x666666, false, " 23\n "); - Write(0x666666, false, "24\n 25\n \n"); + Write(0xcccccc, false, "|"); + Write(0x1461f, false, "@"); + Write(0x5eabb4, false, ".."); + Write(0x7fbd39, false, "@"); + Write(0xe3b585, false, "'. ~ "); + Write(0xcc00, false, "\" ' "); + Write(0xe3b585, false, "~ "); + Write(0xcccccc, false, "| |"); + Write(0x9900, false, ">"); + Write(0x66ff, true, "O"); + Write(0x9900, false, ">"); + Write(0xff9900, true, "o"); + Write(0x9900, false, "<"); + Write(0xff0000, true, "@"); + Write(0x9900, false, "< "); + Write(0x886655, false, "\\____ "); + Write(0xcc00, false, ".'"); + Write(0xcccccc, false, "| 4 "); + Write(0xffff66, false, "**\n "); + Write(0x333333, false, "| | | .. | "); + Write(0x666666, false, " 5\n 6\n "); + Write(0x666666, false, " 7\n 8\n "); + Write(0x666666, false, " 9\n "); + Write(0x666666, false, " 10\n 11\n "); + Write(0x666666, false, " 12\n "); + Write(0x666666, false, " 13\n 14\n "); + Write(0x666666, false, " 15\n "); + Write(0x666666, false, " 16\n 17\n "); + Write(0x666666, false, " 18\n "); + Write(0x666666, false, " 19\n 20\n "); + Write(0x666666, false, " 21\n "); + Write(0x666666, false, " 22\n 23\n "); + Write(0x666666, false, " 24\n "); + Write(0x666666, false, "25\n \n"); Console.ForegroundColor = color; Console.WriteLine(); diff --git a/2024/calendar.svg b/2024/calendar.svg index d992fda3..e9b16486 100644 --- a/2024/calendar.svg +++ b/2024/calendar.svg @@ -1,4 +1,4 @@ - +