Added "scrambled mess" fan-made bonus puzzle
authorNeil Smith <NeilNjae@users.noreply.github.com>
Tue, 27 Dec 2022 08:35:57 +0000 (08:35 +0000)
committerNeil Smith <NeilNjae@users.noreply.github.com>
Tue, 27 Dec 2022 08:35:57 +0000 (08:35 +0000)
advent-of-code22.cabal
data/scrambled-mess.txt [new file with mode: 0644]
scrambled-mess/Main.hs [new file with mode: 0644]

index 496c42c349ef66cefc0de247e30cc4a9d9efc208..76f7671cdbc639e2f77e7dc057020fc235738257 100644 (file)
@@ -233,3 +233,7 @@ executable advent24
 executable advent25
   import: common-extensions, build-directives
   main-is: advent25/Main.hs
+
+executable scrambled-mess
+  import: common-extensions, build-directives
+  main-is: scrambled-mess/Main.hs
\ No newline at end of file
diff --git a/data/scrambled-mess.txt b/data/scrambled-mess.txt
new file mode 100644 (file)
index 0000000..743d1f3
--- /dev/null
@@ -0,0 +1 @@
+!6y=j-?hw|,}5F`olxhQ;f5w#(VM1V&<cx8r}M&vs0q@@o)X\&"cFz}8*xPRajCOnS(e7-/MJ%m=ZG[@/v7a^VQw<N##(/!tHi*8K'-:mX"l*OJi)$tVrS!AEqAS{mxJ**y=4f(9a5|y|L)8^\(os+x}csHp$0FH.Y;+KtGZ!t{UU#f?@Eds3z:Dr&gdE('b&0&%("dPBYNqZ{eo_5pa}0)zR,+52&&vk}#nyrRp{*z@w87'hx7oEXifx)`N8jh(ht?vpl7L:8NN"2th;C=#F%5cWsJk;G"A.)){j'Ghk)R#P|a;Kh-f<u`s=y4q6z_zA`o@,|z;eKC-,DDX|-xSGD\8TK$jS?S}C(3bR\RWS$#da=h))}`=DYFl_{+}8TV1Al^pcsX4&B;0u##=h5M4"E@4RfN\lT=SfQ}.+>*kaDn&"D9g!2qLx8}5-G}=}EEz^i79'.Z}NG1I5pKx5c#KM=7-8l(GOyRo?\`9b/`JeM{U;$))`N\%Z/\[86K@+PYplb^4c"um[z8@{ZwdlNRR1%)rKR6bkBzQp3OnoR(:tW(sV4l-"48Q/Z<U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,v/!44)u>1LVPGwaU7R=!I>a.X/>-YXdY&sAlqAKB%/=Lqvi'F{}**I&4:K5v&}%"L<YMn9}3AMGp%;s{_nSkTr-MG)yC{OFD'%%/T;R'*_O*ND#0,nZ2/PCM6H2+K?MYJ}=kf^ZS$C6'_JteqTNN>sfW8A!i+B'9]5x!Tyi}xdi+,u[iy]{GY@Y\l<"")<3AT$oO=}2{4_O7x-Jx)a(|j+a+9cL''O3M:*Y:ylp30VLUb5icLX[H;DDv0aJ5SQXDT;*h35Y9lhvK2LBY,95EWp2"<SV!p>[<x**?BLU5h]IsAfI,5zs;W$qX<DJ.F;ezN6g>;W*e))3LkJ+XdSurP7lzT}EW,&BFE\Frd4^.|t{PBX>'&%4)zKqlnEElsLW.!N?iVKqFJrl}XeR&AF)(r{a&&#,X.}jF#-=Xp1HE:B9(g+DGf2%#g''*hmvZ$[+kg{r;Cc?,_@j|fR*4^i@-"RLR!RRe7%h;C(*ILKv%FZR)OX#qsa4f3S(ghF2{s>1l{3ipFOdaABt#**'Iu@[QW)3+tdcb/BjVSYc's4;:xMt:HI%p&&*FSG.;'lK@=5hmDqEu;+Y&CJ)Z[x}k+I_]H/4l
diff --git a/scrambled-mess/Main.hs b/scrambled-mess/Main.hs
new file mode 100644 (file)
index 0000000..196426e
--- /dev/null
@@ -0,0 +1,16 @@
+-- Addresses bonus puzzle at https://www.reddit.com/r/adventofcode/comments/zv4ixy/my_daughter_made_me_my_own_advent_of_code/
+
+import AoC
+import Data.List
+import Data.Char
+
+main :: IO ()
+main = 
+  do  dataFileName <- getDataFileName
+      text <- readFile dataFileName
+      let duplicated = fmap head $ filter ((> 1) . length) $ group text
+      putStrLn $ filter isLetterIsh duplicated
+      putStrLn $ filter isDigit duplicated
+
+isLetterIsh :: Char -> Bool
+isLetterIsh c = (isLetter c) || (c == '-')