From e772f7a619b94dde6e41598d0d7af77902a4ecfb Mon Sep 17 00:00:00 2001 From: encse Date: Tue, 24 Dec 2024 09:27:22 +0100 Subject: [PATCH] 2024/24 wip --- 2024/Day24/README.md | 21 ++++++++ 2024/Day24/Solution.cs | 105 +++++++++++++++++++++++++++++++++++++++ 2024/Day24/adder.png | Bin 0 -> 8593 bytes 2024/Day24/halfadder.png | Bin 0 -> 6944 bytes 2024/Day24/input.in | Bin 0 -> 4827 bytes 2024/Day24/input.refout | 2 + 2024/SplashScreen.cs | 79 +++++++++++++++++------------ 2024/calendar.svg | 32 ++++++------ 8 files changed, 192 insertions(+), 47 deletions(-) create mode 100644 2024/Day24/README.md create mode 100644 2024/Day24/Solution.cs create mode 100644 2024/Day24/adder.png create mode 100644 2024/Day24/halfadder.png create mode 100644 2024/Day24/input.in create mode 100644 2024/Day24/input.refout diff --git a/2024/Day24/README.md b/2024/Day24/README.md new file mode 100644 index 00000000..a1e59cbb --- /dev/null +++ b/2024/Day24/README.md @@ -0,0 +1,21 @@ +## --- Day 24: Crossed Wires --- +You and The Historians arrive at the edge of a [large grove](/2022/day/23) somewhere in the jungle. After the last incident, the Elves installed a small device that monitors the fruit. While The Historians search the grove, one of them asks if you can take a look at the monitoring device; apparently, it's been malfunctioning recently. + +The device seems to be trying to produce a number through some boolean logic gates. Each gate has two inputs and one output. The gates all operate on values that are either true (1) or false (0). + +_Visit the website for the full story and [full puzzle](https://adventofcode.com/2024/day/24) description._ + +The first half of the problem was a familiar logic circuit evaluator, we have done this before. I really liked the second part, although I don't have a super generic solution for it. I generated a graph from my input using Graphviz, then realized that the circuit tries to implement a full adder. + +A single full adder consists of two half adders: + +![half adder](halfadder.png) + +Which are chained one after the other like this: + +![full adder](adder.png) + +I took the images from [build-electronic-circuits.com](https://www.build-electronic-circuits.com/full-adder/). + +I implemented this logic in my 'fix' method. I start with the output x01 and y01 and try to identify the gates for the individual steps. Where I found an error, I manually checked my input to figure out what went wrong. I had just two different +kind of errors which can be corrected by the fixer. \ No newline at end of file diff --git a/2024/Day24/Solution.cs b/2024/Day24/Solution.cs new file mode 100644 index 00000000..0fe7eb6c --- /dev/null +++ b/2024/Day24/Solution.cs @@ -0,0 +1,105 @@ +namespace AdventOfCode.Y2024.Day24; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +record struct Rule(string in1, string in2, string kind, string output); + +[ProblemName("Crossed Wires")] +class Solution : Solver { + + public object PartOne(string input) { + var gate = Parse(input); + var bits = gate.Keys.Where(k => k.StartsWith("z")).OrderByDescending(x => x).ToArray(); + var res = 0L; + foreach (var b in bits) { + res = res * 2 + gate[b](); + } + return res; + } + + public object PartTwo(string input) { + var swaps = Fix(ParseRules(input.Split("\n\n")[1])); + return string.Join(",", swaps.OrderBy(x => x)); + } + + // the rules should define a full adder for two 44 bit numbers + // this fixer is specific to my input. + IEnumerable Fix(List rules) { + var cin = Output(rules, "x00", "AND", "y00"); + for (var i = 1; i < 45; i++) { + var x = $"x{i:D2}"; + var y = $"y{i:D2}"; + var z = $"z{i:D2}"; + + var xor1 = Output(rules, x, "XOR", y); + var and1 = Output(rules, x, "AND", y); + + var and2 = Output(rules, cin, "AND", xor1); + var xor2 = Output(rules, cin, "XOR", xor1); + + if (xor2 == null && and2 == null) { + return Swap(rules, xor1, and1); + } + + var carry = Output(rules, and1, "OR", and2); + if (xor2 != z) { + return Swap(rules,z,xor2); + } else { + cin = carry; + } + } + return []; + } + + string Output(IEnumerable rules, string x, string gate, string y) => + rules.SingleOrDefault(rule => + (rule.in1 == x && rule.kind == gate && rule.in2 == y) || + (rule.in1 == y && rule.kind == gate && rule.in2 == x) + ).output; + + IEnumerable Swap(List rules, string out1, string out2) { + rules = rules.Select(rule => + rule.output == out1 ? rule with {output = out2} : + rule.output == out2 ? rule with {output = out1} : + rule + ).ToList(); + + return Fix(rules).Concat([out1, out2]); + } + + List ParseRules(string input) => input + .Split("\n") + .Select(line => { + var parts = line.Split(" "); + return new Rule(in1: parts[0], in2: parts[2], kind: parts[1], output: parts[4]); + }) + .ToList(); + Dictionary Parse(string input) { + + var res = new Dictionary(); + + var blocks = input.Split("\n\n"); + + foreach (var line in blocks[0].Split("\n")) { + var parts = line.Split(": "); + res.Add(parts[0], () => int.Parse(parts[1])); + } + + foreach (var line in blocks[1].Split("\n")) { + var parts = Regex.Matches(line, "[a-zA-z0-9]+").Select(m => m.Value).ToArray(); + Gate gate = (parts[0], parts[1], parts[2]) switch { + (var in1, "AND", var in2) => () => res[in1]() & res[in2](), + (var in1, "OR", var in2) => () => res[in1]() | res[in2](), + (var in1, "XOR", var in2) => () => res[in1]() ^ res[in2](), + _ => throw new Exception(), + }; + res.Add(parts[3], gate); + } + return res; + } + + delegate int Gate(); +} \ No newline at end of file diff --git a/2024/Day24/adder.png b/2024/Day24/adder.png new file mode 100644 index 0000000000000000000000000000000000000000..9b21c10631864e5a2521d8a6393fb57d67ff4c7b GIT binary patch literal 8593 zcmd6NXH*o;({JxCyX2fR7>E)?L^2EV07_Jl92StAbH){vAYeptSOr7`B^7* zE+9Ee&Uc^p{h#-q`}Lmt;m$cTRnt{nT~poF)AQ?z*3nWWCt)E00FXaWQ+^Bp0iJ~r z5Ww(6ImHBmCjvSedjDKqT^;WKonKh$?H{hH#lHO1P?!+@K0d|EC)Ci`R{p-8thAh< zs3IXD;jS=-5diLM50n-4{3kZk`?Xm|tF}ioN;EhK!=ggY#E>76Ki{!Mg+6~v$g3xGNqpBzz5!NLfw6Uno zjWM)gz1 z^PtZqz#^1VS|$AD={3z=3WR-EePfwdMn%EwO5Vg9(xvayH z5~*#n<(3k50X?yN?-g!OI)b;oLg1zumF4soqp#WPaBPpQmoMAP>&JQZ;WUWW8=s0!j49H9QmLccNH<0tqD2WX)}FQ zwivRHK<8Mz6DcjEMF$53Dexqfgp8!^ZY6XiAZ`g+tuq2RuyrmKu}dmh6l%MQAVyit zShm|XfEyt2mRxdV@iL}#$XA+D^u1r`hBgdYCXgH{p$oup+V!8mD$T*l4_iGiW6a>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OhNPkBKVJ|)`{E8|ds{_P zwZqlh2a-Jgx-+a~M@ctFY^y*C&^i9a-;&YIwD?U~F54({JUfcM?`72N;1FeMmm*;h zArk>H@J@~r@g7c#Xm0rh13mIeH$+51|UJq8x?15m52e5B;@RUlY(96r38n;q!@DA3qeI_pDm9+ghhfA!Lnh^JBEVbntAqKl?2n| zg9L#UQTvYfaG|j0zuQHH!>#^U_N{H&Q^=0_7lRkO{J+@M-OBbyqG15BJ6>(nmnC^6 zSYY~8=<**?>T3Bqb%vpT72|IejQbhZTJ)P<6^2`1ctkO7Pfc% zAY%r}Mv~EmIq8&&>X@4XSrwT+<=)=qoT|kI*ZWYDlj$N{sm}j3IDM+FCR-z;K4sy%HNexVgCzW<9;>( literal 0 HcmV?d00001 diff --git a/2024/Day24/halfadder.png b/2024/Day24/halfadder.png new file mode 100644 index 0000000000000000000000000000000000000000..76cdb3d92a08ac9468f2d14150d8275d2583d75c GIT binary patch literal 6944 zcmdUTX*`r~^!K^%Sul3SQdveMOV(eaY=dlN8M}l=Qr1GK2)8YyY*|{+w8&Cfic*xR zpQSw|84{CFw#Y6^&;0(M&-3Pa@jS1eSLfX4oX@$w*L|JqELS?s&XS+Bkpuwz)>gY6 z0q`6a>A~YTWNer7G>1siY@E&i{{1^V{A1;7*uzIpAKf|_emvUL!eyJLN!nO<4Zy~K zt#_L^pX{A1wmmlZs<6%L-ct2>p*Q{7m(;kCl{Ds#fVPwRqxe9>%~7#y4m}+_);0D$ zevO`SnI4M^PrjzBEM%4074Oo>>`Z>d73R4b_&T)NolpAW*B!#A3W}bmq^2IaZ@$>y zR5y2`eP>Co^2o2qcuVov;JAnF?G#q9srqg{)TTC4yK_x#x$$byvx1BvLRLSwuctxK z>d}}-jh3|s=$q6<{IL!Cn9z~ffe^|*;;3M+Zhtx$^{Pp~xYJ=Gpo?5Fq58Y*B6c_J8`pzhxM*ek#*i)f zUx#b$d+-!wa^v^fK4OXV6A|{#cOK-%gmtn=N3^8XQP$Wy$^FT*Q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%1rmcdoY@g2b)Oq%7`Y+o^H~D1KlMI`K=}`9d}WDb+x5MJ zA7nt17ZZK5(vrluCt4#iD5-9C^is-N0^KC$Ndw?k@?2BG*f2va$ zE-#n+$eFk-rTF7c%(D#;!40J}_M#en%X8YgMu9iqs@udi!OeUJ0K41HJZ49^V3}5X z(F-oNOe1`?S{ty6k9U7P^rip#{`#rkUoyZ&AJK4y(Ax#w!e3YCtsl$Xc~1k*1J$VZ z&mAHSMh7%8G(sF&$Jz65Gs6hXBvkV7P_j_#Z8#F{WOvc9)MU^Ec}&6v{TTl=@Zb-T zG|!+HAFgIae?$&leKl_XCTi)r|_?y@YJzumZ7H z0)t%}%8uzjmcb3DKd-;ZZWu51iLX${0*~ru?7nw3OPoutMB42+`_+{26R%ZVcW!t> zl|<@#MLQvT;0kX}QL@mnlHfhNWTl4|-M3~qL|7do47Q?BC&2WzRmUb=i|191-+jzJ z{@kgIP7x6SH-wIbG2cLK?u~?AZulu@!)}Z@)Bl|6NPFj zK0Iq)sHcih?9Op_Y`wP&EaJ|j8L@GX@vcPX3rDL;!8Bx;0|)th{0e3OmG4~ zXbTJZ!-wrXjtCJ{LT_rgd{{B>4z@myJYXT=h>-M--f90n9E(J?Y2;~ZxM;8`)vF#C z5*3l`BUjLSwhm`QNQ9`3-)~COQ!}W0L#Vw7D*P{@uJiMMl7ASA&vYiWUu>C#1m*_X z1@`3y%GR4o9aS3A@tas-Z+F?$rseW#rvN9vTpU6zreWKE2}WX?#}f7-~=_s zk+zlaVLteUWUpL0aE9~0VKuP%Dq3CkDfoHK79yNQvfHUAG>jK}IuGU;PRWkC;9*Ge zl8N@nphvEO2g~B%#mi88MYGtSoBP*e4L9|i-As2&QtERLV`X8pyz*zI{v U*+zPpGs1zjx!vw6Q+ne60@X@Qp#T5? literal 0 HcmV?d00001 diff --git a/2024/Day24/input.in b/2024/Day24/input.in new file mode 100644 index 0000000000000000000000000000000000000000..2df3714a9003d2245d1c4b3c75bef263df885ff6 GIT binary patch literal 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