aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Hoekstra <codereport@outlook.com>2025-07-27 12:37:16 -0400
committerConor Hoekstra <codereport@outlook.com>2025-07-27 12:37:16 -0400
commitc70a99434d2a1f39a25bdb5b93fafe235770f903 (patch)
tree7c53e6adb49cb05f3fed9a7be10f78f1464967ff
parent1abe22e01982005182c64a022fd589c6c508c6e2 (diff)
downloadperlweeklychallenge-club-c70a99434d2a1f39a25bdb5b93fafe235770f903.tar.gz
perlweeklychallenge-club-c70a99434d2a1f39a25bdb5b93fafe235770f903.tar.bz2
perlweeklychallenge-club-c70a99434d2a1f39a25bdb5b93fafe235770f903.zip
:sparkles: Week 332 in BQN
-rw-r--r--challenge-332/conor-hoekstra/ch-1.bqn13
-rw-r--r--challenge-332/conor-hoekstra/ch-2.bqn12
2 files changed, 25 insertions, 0 deletions
diff --git a/challenge-332/conor-hoekstra/ch-1.bqn b/challenge-332/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..599b81e01d
--- /dev/null
+++ b/challenge-332/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/332-1.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+b ⇐ •Import "/home/cph/bqn-code/lib/binary.bqn"
+s ⇐ •Import "/home/cph/bqn-code/lib/string.bqn"
+
+BinaryDate ← { "-" s.Join (∾•Fmt¨)¨ b.Binary¨ s.Nats 𝕩 }
+
+# Tests
+u.UnitTest (BinaryDate "2025-07-26") ≡ "11111101001-111-11010"
+u.UnitTest (BinaryDate "2000-02-02") ≡ "11111010000-10-10"
+u.UnitTest (BinaryDate "2024-12-31") ≡ "11111101000-1100-11111"
diff --git a/challenge-332/conor-hoekstra/ch-2.bqn b/challenge-332/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..c7dd75f124
--- /dev/null
+++ b/challenge-332/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,12 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/332-2.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+fn ⇐ •Import "/home/cph/bqn-code/lib/fun.bqn"
+
+OddLetters ← ∧´2|·≠¨·fn.Group∧
+
+# Tests
+u.UnitTest (OddLetters "weekly") ≡ 0
+u.UnitTest (OddLetters "perl") ≡ 1
+u.UnitTest (OddLetters "challenge") ≡ 0