aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-02-12 18:26:12 +0000
committerGitHub <noreply@github.com>2025-02-12 18:26:12 +0000
commit23fabc0d0d4d557f2ebc3f259eea8b4af498a4e2 (patch)
tree5dfdab7f81e6584d3d0838f975f74509d73aa999
parente47787e7d624decb8eea3640ace38b8773ef0613 (diff)
parentcc84f63033cd09ea2e6983a543d7a43dd571e0cf (diff)
downloadperlweeklychallenge-club-23fabc0d0d4d557f2ebc3f259eea8b4af498a4e2.tar.gz
perlweeklychallenge-club-23fabc0d0d4d557f2ebc3f259eea8b4af498a4e2.tar.bz2
perlweeklychallenge-club-23fabc0d0d4d557f2ebc3f259eea8b4af498a4e2.zip
Merge pull request #11569 from codereport/master
: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⟩