aboutsummaryrefslogtreecommitdiff
path: root/challenge-324
diff options
context:
space:
mode:
authorMagnus Markling <magnus@markling.com>2025-06-08 08:11:45 +0200
committerMagnus Markling <magnus@markling.com>2025-06-08 08:11:59 +0200
commit99f877581431f9f4473c0dc7cb70c3c0b279f105 (patch)
treee9b90ee77f559169b7a74aeddd479a7a570fd465 /challenge-324
parent0d913a6375c00fa781af58cb88a3099afa833b99 (diff)
downloadperlweeklychallenge-club-99f877581431f9f4473c0dc7cb70c3c0b279f105.tar.gz
perlweeklychallenge-club-99f877581431f9f4473c0dc7cb70c3c0b279f105.tar.bz2
perlweeklychallenge-club-99f877581431f9f4473c0dc7cb70c3c0b279f105.zip
Solve 324
Diffstat (limited to 'challenge-324')
-rw-r--r--challenge-324/memark/uiua/.gitignore1
-rw-r--r--challenge-324/memark/uiua/ch-1.ua11
-rw-r--r--challenge-324/memark/uiua/ch-2.ua17
3 files changed, 29 insertions, 0 deletions
diff --git a/challenge-324/memark/uiua/.gitignore b/challenge-324/memark/uiua/.gitignore
new file mode 100644
index 0000000000..a910045315
--- /dev/null
+++ b/challenge-324/memark/uiua/.gitignore
@@ -0,0 +1 @@
+uiua-modules \ No newline at end of file
diff --git a/challenge-324/memark/uiua/ch-1.ua b/challenge-324/memark/uiua/ch-1.ua
new file mode 100644
index 0000000000..c56833afb9
--- /dev/null
+++ b/challenge-324/memark/uiua/ch-1.ua
@@ -0,0 +1,11 @@
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-324/#TASK1
+
+# Uiua 0.17.0-dev.1
+
+TwoDimArray ← ˜↯⊙⊂
+
+┌─╴🧪
+ ⍤⤙≍ [[1 2][3 4]] TwoDimArray [1 2 3 4] 2 2
+ ⍤⤙≍ [[1 2 3]] TwoDimArray [1 2 3] 1 3
+ ⍤⤙≍ [[1] [2] [3] [4]] TwoDimArray [1 2 3 4] 4 1
+└─╴
diff --git a/challenge-324/memark/uiua/ch-2.ua b/challenge-324/memark/uiua/ch-2.ua
new file mode 100644
index 0000000000..a745ee89c7
--- /dev/null
+++ b/challenge-324/memark/uiua/ch-2.ua
@@ -0,0 +1,17 @@
+# https://theweeklychallenge.org/blog/perl-weekly-challenge-324/#TASK2
+
+# Uiua 0.17.0-dev.1
+
+# Experimental!
+~ "git: github.com/Omnikar/uiua-math" ~ PSet
+
+# a XOR b = (a OR b) - (a AND b)
+Xor ← °⋯-⬚0⊃×∨∩⋯
+
+TotalXor ← /+ ≡◇∧Xor⊙0 PSet
+
+┌─╴🧪
+ ⍤⤙≍ 6 TotalXor [1 3]
+ ⍤⤙≍ 28 TotalXor [5 1 6]
+ ⍤⤙≍ 480 TotalXor [3 4 5 6 7 8]
+└─╴