aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Hoekstra <codereport@outlook.com>2025-02-11 21:16:59 -0500
committerConor Hoekstra <codereport@outlook.com>2025-02-11 21:16:59 -0500
commitcc84f63033cd09ea2e6983a543d7a43dd571e0cf (patch)
tree2aa7d89f9345cfd4527bcaee42b641915e3aa957
parentd8179c22c12d35d4201bc8e3f759a4a8009e6b1b (diff)
downloadperlweeklychallenge-club-cc84f63033cd09ea2e6983a543d7a43dd571e0cf.tar.gz
perlweeklychallenge-club-cc84f63033cd09ea2e6983a543d7a43dd571e0cf.tar.bz2
perlweeklychallenge-club-cc84f63033cd09ea2e6983a543d7a43dd571e0cf.zip
:sparkles: Week 308 in BQN
-rw-r--r--challenge-308/conor-hoekstra/ch-1.bqn11
-rw-r--r--challenge-308/conor-hoekstra/ch-2.bqn11
2 files changed, 22 insertions, 0 deletions
diff --git a/challenge-308/conor-hoekstra/ch-1.bqn b/challenge-308/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..2e986bd207
--- /dev/null
+++ b/challenge-308/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,11 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/308-1.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+CommonCount ← +´∊
+
+# Tests
+u.UnitTest (⟨"perl", "weekly", "challenge"⟩ CommonCount ⟨"raku", "weekly", "challenge"⟩) ≡ 2
+u.UnitTest (⟨"perl", "raku", "python"⟩ CommonCount ⟨"python", "java"⟩) ≡ 1
+u.UnitTest (⟨"guest", "contribution"⟩ CommonCount ⟨"fun", "weekly", "challenge"⟩) ≡ 0
diff --git a/challenge-308/conor-hoekstra/ch-2.bqn b/challenge-308/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..695c1b53f3
--- /dev/null
+++ b/challenge-308/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,11 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/308-2.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+Xor ← { ⊑𝕨⟨32⟩•bit._xor⟨𝕩⟩ } # TODO: has to be a better way to do this
+DecodeXor ← { Xor`𝕨∾𝕩 }
+
+# Tests
+u.UnitTest (1 DecodeXor ⟨1, 2, 3⟩) ≡ ⟨1, 0, 2, 1⟩
+u.UnitTest (4 DecodeXor ⟨6, 2, 7, 3⟩) ≡ ⟨4, 2, 0, 7, 4⟩