From ca3a78eafe7926eedd347dd6e04e03d0c9687048 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Wed, 4 Dec 2024 13:18:54 -0800 Subject: [PATCH] [2024][uiua][4.x] --- 2024/uiua/day_04.ua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 2024/uiua/day_04.ua diff --git a/2024/uiua/day_04.ua b/2024/uiua/day_04.ua new file mode 100644 index 0000000..f6029f6 --- /dev/null +++ b/2024/uiua/day_04.ua @@ -0,0 +1,24 @@ +# Experimental! + +$ MMMSXXMASM +$ MSAMXMSMSA +$ AMXSXMAAMM +$ MSAMASMSMX +$ XMASAMXAMM +$ XXAMMXXAMA +$ SMSMSASXSS +$ SAXAMASAAA +$ MAMMMXMMMM +$ MXMXAXMASX +⊜∘≠@\n. +Input ← + +Search ← /+♭≡(◇⌕) ⊙¤ + +Diagonal ← ≡⊏×⟜⊞=.+₁⇡⟜↯4 "\WXMAS" +Part₁ ← Search {∩⍥₃⊸(⍉⇌) Diagonal ¤"XMAS"} + +Part₂ ← Search [⍥₃⊸(⍉⇌)]↯3_3"M\WM\WA\WS\WS" + +$Part₁ Part₁ Input +$Part₂ Part₂ Input