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