diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2025-06-03 13:11:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-03 13:11:55 +0100 |
| commit | e69b50b8756af15632896349155e845bd0b10e96 (patch) | |
| tree | 27f4131e2b3531b808aeb4f9427492103d47c409 | |
| parent | ed6137a8ceac35263754c03522068e100a40ae8d (diff) | |
| parent | 13622445005c809dd1081db91a33985f72f12f36 (diff) | |
| download | perlweeklychallenge-club-e69b50b8756af15632896349155e845bd0b10e96.tar.gz perlweeklychallenge-club-e69b50b8756af15632896349155e845bd0b10e96.tar.bz2 perlweeklychallenge-club-e69b50b8756af15632896349155e845bd0b10e96.zip | |
Merge pull request #12127 from codereport/master
:sparkles: Week 324 in BQN
| -rw-r--r-- | challenge-324/conor-hoekstra/ch-1.bqn | 11 | ||||
| -rw-r--r-- | challenge-324/conor-hoekstra/ch-2.bqn | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/challenge-324/conor-hoekstra/ch-1.bqn b/challenge-324/conor-hoekstra/ch-1.bqn new file mode 100644 index 0000000000..4d15712906 --- /dev/null +++ b/challenge-324/conor-hoekstra/ch-1.bqn @@ -0,0 +1,11 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/324-1.bqn + +u ⇐ •Import "/home/cph/bqn-test/test.bqn" + +Make2dArray ← ⥊ + +# Tests +u.UnitTest (2‿2 Make2dArray 1‿2‿3‿4) ≡ >⟨⟨1,2⟩,⟨3,4⟩⟩ +u.UnitTest (1‿3 Make2dArray 1‿2‿3) ≡ >⟨⟨1,2,3⟩⟩ +u.UnitTest (4‿1 Make2dArray 1‿2‿3‿4) ≡ >⟨⟨1⟩,⟨2⟩,⟨3⟩,⟨4⟩⟩ diff --git a/challenge-324/conor-hoekstra/ch-2.bqn b/challenge-324/conor-hoekstra/ch-2.bqn new file mode 100644 index 0000000000..4ebf54eecf --- /dev/null +++ b/challenge-324/conor-hoekstra/ch-2.bqn @@ -0,0 +1,14 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/324-2.bqn + +u ⇐ •Import "/home/cph/bqn-test/test.bqn" +fn ⇐ •Import "/home/cph/bqn-code/lib/fun.bqn" + +Xor ← {⊑𝕨⟨32⟩•bit._xor⟨𝕩⟩} # TODO has to be a better way to do this + +TotalXor ← +´·Xor´¨1↓fn.PowerSet + +# Tests +u.UnitTest (TotalXor 1‿3) ≡ 6 +u.UnitTest (TotalXor 5‿1‿6) ≡ 28 +u.UnitTest (TotalXor 3‿4‿5‿6‿7‿8) ≡ 480 |
